mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-06 18:35:19 +00:00
THRIFT-5454: add __setState__ function to TProcessPoolServer to enable correct multiprocessing behavior related to pickling
Client: Python
This commit is contained in:
parent
ea39a14a1f
commit
da1e19b72b
@ -42,6 +42,11 @@ class TProcessPoolServer(TServer):
|
||||
self.stopCondition = Condition()
|
||||
self.postForkCallback = None
|
||||
|
||||
def __getstate__(self):
|
||||
state=self.__dict__.copy()
|
||||
state['workers'] = None
|
||||
return state
|
||||
|
||||
def setPostForkCallback(self, callback):
|
||||
if not callable(callback):
|
||||
raise TypeError("This is not a callback!")
|
||||
|
Loading…
Reference in New Issue
Block a user