Message Boards Message Boards

0
|
2628 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Run ChannelListeners in remote kernel or local kernel?

Posted 7 years ago

Has anyone had any success on running a channel listener in a kernel. eg

  1. Create Channel (CreateChannel["test" ])
  2. Spin up kernel to process resuls
  3. Send channel message from another process.

I can not get the channel listener active in this scenario. When I run it from the front end it works but in the kernel it does not. Any suggestions would be appreciated:

     list = {1,   2}; 
   ParallelMap[{Print["Processing job: ", #]; 
   listener = ChannelListen["test", myfunc]; 
   Print["listener: ", listener, " kern ", $KernelID, " job ", #]; 
   Pause[60]} &, list]

   myfunc[a_Association] := 
     Module[{}, 
      Print["printed from my func", a , " in kern: ", $KernelID] ];

IN ANOTHER SESSION: ChannelSend["test", <|"a" -> "hello", "msg" -> RandomReal[]|>]

POSTED BY: Scott Sproule
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract