Allow non hashable args/kwargs

NamedTuple hash is the hash of all args, we don't really
want this. args/kwargs can be non-hashable.

So we use our own class.
This commit is contained in:
Mehdi Abaakouk 2016-07-07 10:12:47 +02:00
parent 9a19bf0748
commit 9f006f2860
1 changed files with 6 additions and 4 deletions

View File

@ -32,10 +32,12 @@ SIGNAL_TO_NAME = dict((getattr(signal, name), name) for name in dir(signal)
'SIG_IGN'))
_ServiceConfig = collections.namedtuple("ServiceConfig", ["service",
"workers",
"args",
"kwargs"])
class _ServiceConfig(object):
def __init__(self, service, workers, args, kwargs):
self.service = service
self.workers = workers
self.args = args
self.kwargs = kwargs
def _spawn(target):