Add monkey_patch to demo code.

The RPC server code can not work if we
don't add eventlet.monkey_patch() at the
begining.

Change-Id: I65a162a427fb5615c95a70e6d1bbec899a78f231
This commit is contained in:
zhiCHang1990 2017-07-06 15:19:46 +08:00
parent b36cfac525
commit 1389893dd0
1 changed files with 7 additions and 0 deletions

View File

@ -73,6 +73,13 @@ complete after the Server has been stopped.
A simple example of an RPC server with multiple endpoints might be::
# NOTE(changzhi): We are using eventlet executor and
# time.sleep(1), therefore, the server code needs to be
# monkey-patched.
import eventlet
eventlet.monkey_patch()
from oslo_config import cfg
import oslo_messaging
import time