Forum Navigation
Tango cluster issues!
Moderators:
kris
Posted: 04/11/09 13:37:09 Modified: 04/11/09 13:37:29Can not make any use of the tango.net.cluster facilities!!!
1. First off: The following example (taken from the site) works only if compiled with DMD. If compiled with GDC it fails with Segmentation Fault somewhere at the cluster.join call:
Bulletin.d:
module Bulletin; private import tango.core.Thread; private import tango.net.cluster.NetworkAlert; private import tango.net.cluster.tina.Cluster; private import tango.util.log.Log; private import tango.util.log.AppendConsole; void main() { // initialize log Log.root.add(new AppendConsole()); // hook into the cluster auto cluster = (new Cluster).join; // hook into the Alert layer auto alert = new NetworkAlert (cluster, "my.kind.of.alert"); // declare a listener void listen (IEvent event) { event.log.info ("Received alert on channel " ~ event.channel.name); } // listen for the broadcast (on this channel) alert.createConsumer (&listen); // and send everyone an empty alert (on this channel) alert.broadcast; // wait for it to arrive ... Thread.sleep(1); }2. Moreover, if I split the code above into 2 distinct programs (BulletinListener?.d and BulletinBroadcaster?.d) and run them concurrently, the BulletinListener? shows the message:
2506 Error cluster.generic - BulletinConsumer: input buffer is emptymodule BulletinListener; private import tango.core.Thread; private import tango.net.cluster.NetworkAlert; private import tango.net.cluster.tina.Cluster; private import tango.util.log.Log; private import tango.util.log.AppendConsole; void main() { // initialize log Log.root.add(new AppendConsole()); // hook into the cluster auto cluster = (new Cluster).join; // hook into the Alert layer auto alert = new NetworkAlert (cluster, "my.kind.of.alert"); // declare a listener void listen (IEvent event) { event.log.info ("Received alert on channel " ~ event.channel.name); } // listen for the broadcast (on this channel) alert.createConsumer (&listen); // wait for it to arrive ... Thread.sleep(10); }module BulletinBroadcaster; private import tango.core.Thread; private import tango.net.cluster.NetworkAlert; private import tango.net.cluster.tina.Cluster; private import tango.util.log.Log; private import tango.util.log.AppendConsole; void main() { // initialize log Log.root.add(new AppendConsole()); // hook into the cluster auto cluster = (new Cluster).join; // hook into the Alert layer auto alert = new NetworkAlert (cluster, "my.kind.of.alert"); // and send everyone an empty alert (on this channel) alert.broadcast; // wait for it to arrive ... Thread.sleep(1); }Am I doing something wrong? I was looking forward to use tango clustering and now it seems that it is simply not stable at all.
I would appreciate any help in this matter. Thanks.
Checkout Palos::Code.Blog()