Skip to content

Commit

Permalink
Add ForkReply
Browse files Browse the repository at this point in the history
  • Loading branch information
edisongustavo committed Sep 9, 2019
1 parent 03a29e4 commit 083458e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def post_fork_callback(pid, conn):
metadata = {}
metadata = self.finish_metadata(parent, metadata, reply_content)

self.session.send(stream, u'execute_reply',
self.session.send(stream, u'fork_reply',
reply_content, parent, metadata=metadata,
ident=ident)

Expand Down
2 changes: 1 addition & 1 deletion ipykernel/tests/test_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def test_fork_metadata():
km = kc.parent
fork_msg_id = kc.fork()
fork_reply = kc.get_shell_msg(block=True, timeout=TIMEOUT)
# validate_message(fork_reply, "execute_reply", fork_msg_id) # TODO: Make it work (need the `fork_reply`)
validate_message(fork_reply, "fork_reply", fork_msg_id)
assert fork_msg_id == fork_reply['parent_header']['msg_id'] == fork_msg_id
assert fork_reply['content']['conn']['key'] != kc.session.key.decode()
fork_pid = fork_reply['content']['pid']
Expand Down
6 changes: 6 additions & 0 deletions ipykernel/tests/test_message_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ class IsCompleteReplyIncomplete(Reference):
indent = Unicode()


class ForkReply(Reply):
pid = Integer()
conn = Dict()


# IOPub messages

class ExecuteInput(Reference):
Expand Down Expand Up @@ -240,6 +245,7 @@ class HistoryReply(Reply):
'stream' : Stream(),
'display_data' : DisplayData(),
'header' : RHeader(),
'fork_reply' : ForkReply(),
}
"""
Specifications of `content` part of the reply messages.
Expand Down

0 comments on commit 083458e

Please sign in to comment.