Version 4 of Spread

Updated 2005-08-30 21:09:03 by escargo

Tcl interface to spread

...and "spread" is...? -- CLN

http://www.spread.org/

"Spread is a toolkit that provides a high performance messaging service that is resilient to faults across external or internal networks. Spread functions as a unified message bus for distributed applications, and provides highly tuned application-level multicast and group communication support."

In other words, a robust pub-sub messaging system.

   package require spread
   set mbox [spread connect 4803@localhost]

   $mbox send channela "hello, world"
   $mbox send -type RELIABLE_MESS channelb "hello, sailor"

   proc receive_message {mbox} {
       set message [$mbox receive]
       foreach {message_type sender groups message_text} $message {break}
       puts "message received is $message_text"
   }

   $mbox onmsg receive_message
   $mbox join somechannel

   $mbox leave somechannel
   $mbox disconnect

The biggest thing missing right now is the inability to handle membership messages. There's some other stuff I want to add (handle configuration for tuning, multigroup multicast) but haven't gotten to yet.


See also:


Category Interprocess Communication