Search code examples
pythontwistedspyne

Handling multiple clients with twisted and spyne


I'm trying to create a simple python server that can handle multiple RCP calls at the same time. I would like to use twisted for the networking and spyne to handle the RPCs. I found a good example in the spyne github repo here, but when I make a call to say_hello_with_sleep using curl I get an error.

exceptions.AssertionError: It looks like this protocol is not async-compliant yet

This is the only one of the RPCs thats doesn't seem to work and the one that defines the type of nonblocking call I'm looking for.

The final RPCs that I need to implement will take around 40 sec to process before returning the request and Im honestly not sure if this is the best way to go about handling multiple requests at the same time.

Any help or direction would be greatly appreciated. Thanks!


Solution

  • This is fixed and will be released as part of Spyne 2.13.

    You can use code from the master branch of http://github.com/arskom/spyne if you can't wait an indefinite amount of time until the release. Code only gets merged there if it passes all tests.