Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
guix-hpc
guix-kernel
Commits
22b789fc
Commit
22b789fc
authored
Jul 18, 2019
by
Ludovic Courtès
Browse files
messages: 'message-parts' accepts #f as the recipient.
* jupyter/messages.scm (message-parts): Allow #:recipients to be #f.
parent
3b418494
Changes
1
Hide whitespace changes
Inline
Side-by-side
jupyter/messages.scm
View file @
22b789fc
...
...
@@ -122,7 +122,7 @@ with KEY, another string."
(
recipient
(
and=>
(
message-parent-header
message
)
header-sender
)))
"Return the list of parts (bytevectors) of MESSAGE for RECIPIENT, a ZeroMQ
identity (a bytevector).
identity (a bytevector)
of #f if there's no specific recipient
.
This is a low-level procedure for internal use."
(
let*
((
header
(
header->string
(
message-header
message
)))
...
...
@@ -133,11 +133,16 @@ This is a low-level procedure for internal use."
(
content
(
message-content
message
))
(
payload
(
string-append
header
parent
metadata
content
))
(
signature
(
get-signature
key
payload
)))
(
cons*
recipient
DELIM
(
map
string->utf8
(
list
signature
header
parent
metadata
content
)))))
;; Per
;; <https://jupyter-client.readthedocs.io/en/latest/messaging.html#the-wire-protocol>,
;; the identities part before DELIM "can be zero or more socket
;; identities". Here we accept zero or one.
`
(
,@
(
if
recipient
(
list
recipient
)
'
())
,
DELIM
,@
(
map
string->utf8
(
list
signature
header
parent
metadata
content
)))))
(
define
(
reply
message
type
content
)
"Return a Jupyter message that is a reply to MESSAGE."
...
...
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