Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
adf52744
Commit
adf52744
authored
Mar 26, 2018
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue #155: parent: split out make_call_msg().
parent
d23a6174
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
13 deletions
+14
-13
mitogen/parent.py
mitogen/parent.py
+14
-13
No files found.
mitogen/parent.py
View file @
adf52744
...
...
@@ -253,6 +253,19 @@ def upgrade_router(econtext):
)
def
make_call_msg
(
fn
,
*
args
,
**
kwargs
):
if
isinstance
(
fn
,
types
.
MethodType
)
and
\
isinstance
(
fn
.
im_self
,
(
type
,
types
.
ClassType
)):
klass
=
fn
.
im_self
.
__name__
else
:
klass
=
None
return
mitogen
.
core
.
Message
.
pickled
(
(
fn
.
__module__
,
klass
,
fn
.
__name__
,
args
,
kwargs
),
handle
=
mitogen
.
core
.
CALL_FUNCTION
,
)
def
_docker_method
():
import
mitogen.docker
return
mitogen
.
docker
.
Stream
...
...
@@ -496,19 +509,7 @@ class Context(mitogen.core.Context):
def
call_async
(
self
,
fn
,
*
args
,
**
kwargs
):
LOG
.
debug
(
'%r.call_async(%r, *%r, **%r)'
,
self
,
fn
,
args
,
kwargs
)
if
isinstance
(
fn
,
types
.
MethodType
)
and
\
isinstance
(
fn
.
im_self
,
(
type
,
types
.
ClassType
)):
klass
=
fn
.
im_self
.
__name__
else
:
klass
=
None
return
self
.
send_async
(
mitogen
.
core
.
Message
.
pickled
(
(
fn
.
__module__
,
klass
,
fn
.
__name__
,
args
,
kwargs
),
handle
=
mitogen
.
core
.
CALL_FUNCTION
,
)
)
return
self
.
send_async
(
make_call_msg
(
fn
,
*
args
,
**
kwargs
))
def
call
(
self
,
fn
,
*
args
,
**
kwargs
):
receiver
=
self
.
call_async
(
fn
,
*
args
,
**
kwargs
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment