Skip to content

Instantly share code, notes, and snippets.

@davidszotten
Created June 11, 2015 14:45
Show Gist options
  • Select an option

  • Save davidszotten/2025f3b426f8619f8f51 to your computer and use it in GitHub Desktop.

Select an option

Save davidszotten/2025f3b426f8619f8f51 to your computer and use it in GitHub Desktop.
Nameko rpc step-through
add `import pdb; pdb.set_trace()` to `RpcConsumer.handle_message` and `ReplyListener.handle_message`
import eventlet
from nameko.rpc import RpcProxy
from nameko.testing.services import once
class MyClient(object):
name = 'my_client'
server_rpc = RpcProxy('my_server')
@once
def caller(self):
eventlet.sleep(.1) # `once` fires too early (bug?)
import pdb; pdb.set_trace()
print self.server_rpc.my_method(value=12)
from nameko.rpc import rpc
class MyServer(object):
name = 'my_server'
@rpc
def my_method(self, value):
return value + 1
@davidszotten
Copy link
Author

demo used https://pypi.python.org/pypi/pdbpp/ with sticky mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment