Question: A Protocol should unpack some binary data. this is done in
seperate calls to struct.unpack . Inbetween i do some checks for
length, some strings returned are concatenated using join and logs are
written. This all happens in the factory of the Protocol. To keep the
code unblocking would it be wiser to spawn new Threads from the
Protocol around the whole function, like:
d = threads.deferToThread(self.factory.readPackage, data)
 because it all has to happen after one another anyway.
Or should i split it up in deferreds which if i get it correctly would
mean to create callback functions for each of the unpack()'s, join()'s
and str()'s
thanks

_______________________________________________
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to