Created
September 21, 2015 23:43
-
-
Save kylekyle/8751d692e2a0956ddd08 to your computer and use it in GitHub Desktop.
Blocking bidirectional communication in IRuby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comm = IRuby::Comm.new("prompter") | |
comm.open | |
session = IRuby::Kernel.instance.session | |
message = session.instance_eval do | |
unserialize(@sockets[:reply].recv_message) | |
end | |
comm.close | |
message[:content]['data'] | |
__DATA__ | |
IPython.notebook.kernel.comm_manager.register_target("prompter", function(prompter){ | |
prompter.send("foobarcatz"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment