master: use decorators rather than call_with_deadline(with_context=..)
This commit is contained in:
parent
d6d83b3fac
commit
4ff1d4e523
|
@ -738,7 +738,8 @@ def upgrade_router(econtext):
|
||||||
ModuleForwarder(econtext.router, econtext.parent, econtext.importer)
|
ModuleForwarder(econtext.router, econtext.parent, econtext.importer)
|
||||||
|
|
||||||
|
|
||||||
def _proxy_connect(econtext, name, context_id, method_name, kwargs):
|
@mitogen.core.takes_econtext
|
||||||
|
def _proxy_connect(name, context_id, method_name, kwargs, econtext):
|
||||||
upgrade_router(econtext)
|
upgrade_router(econtext)
|
||||||
context = econtext.router._connect(
|
context = econtext.router._connect(
|
||||||
context_id,
|
context_id,
|
||||||
|
@ -855,8 +856,8 @@ class Router(mitogen.core.Router):
|
||||||
context_id = self.allocate_id()
|
context_id = self.allocate_id()
|
||||||
# Must be added prior to _proxy_connect() to avoid a race.
|
# Must be added prior to _proxy_connect() to avoid a race.
|
||||||
self.add_route(context_id, via_context.context_id)
|
self.add_route(context_id, via_context.context_id)
|
||||||
name = via_context.call_with_deadline(None, True,
|
name = via_context.call(_proxy_connect,
|
||||||
_proxy_connect, name, context_id, method_name, kwargs
|
name, context_id, method_name, kwargs
|
||||||
)
|
)
|
||||||
# name = '%s.%s' % (via_context.name, name)
|
# name = '%s.%s' % (via_context.name, name)
|
||||||
context = Context(self, context_id, name=name)
|
context = Context(self, context_id, name=name)
|
||||||
|
|
Loading…
Reference in New Issue