Skip to content

Commit

Permalink
Add __getstate__ and __setstate__ for IterableQueue (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
chscheller authored Jan 5, 2022
1 parent 5231806 commit 00b0e22
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pypeln/process/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ def get_pipeline_exception(self, exception: BaseException) -> PipelineException:

return PipelineException(exception_type, trace)

def __getstate__(self):
return super().__getstate__() + (self.namespace, self.exception_queue)

def __setstate__(self, state):
super().__setstate__(state[:-2])
self.namespace, self.exception_queue = state[-2:]


class OutputQueues(tp.List[IterableQueue[T]], tp.Generic[T]):
def put(self, x: T):
Expand Down

0 comments on commit 00b0e22

Please sign in to comment.