[Twisted-Python] "blocking" on a response to a client

Chris Withers chris at simplistix.co.uk
Tue Nov 6 04:42:00 MST 2018


On 05/11/2018 18:32, meejah wrote:
> Chris Withers <chris at simplistix.co.uk> writes:
>
>> So, separate question: I have a client that's making a connection to a
>> websocket from a server. The client needs to send an "auth" message
>> once the websocket is up, and the client code shouldn't progress until
>> it receives an affirmative response. How do I do this in a
>> non-blocking way when using twisted? (inside an inlineDeferred method
>> in this case!)
>
> There's nothing really special about an @inlineCallbacks method -- it
> just returns a Deferred so you can handle it like any other
> Deferred-returning method.

Thanks, but the special bit I was asking about is having my 
application's logical flow pause until the websocket is successfully up 
and a successful response has been received, all without blocking the 
reactor.

How do I do that?

Chris




More information about the Twisted-Python mailing list