If I create a looping task using twisted.internet.task.LoopingCall, how can that task safely access a client’s twisted connection and send data it collects? Are the tasks run in separate threads meaning it might not be safe to send data from the task itself? Can I pass the task a reference to the client (instance of a LineReceiver) for it to send data out from?
If I create a looping task using twisted.internet.task.LoopingCall, how can that task safely access
Share
No. The tasks are not run in different threads; one might say that’s the whole point of using Twisted in the first place. You are intended to be able to pass references to your protocol objects wherever you need them.