MessageBus like Channel

40 views
Skip to first unread message

Steve Wagner

unread,
Jun 9, 2009, 4:23:05 AM6/9/09
to retla...@googlegroups.com
Hi, currently i can use a channel as simple message bus when i use
Channel<object>.

But that is not very nice, so what is your sentences to add a MessageBus
(Maybe with another name) class which wraps a channel<object>. The
difference would be that the subscriber is automatically filtered. So
you can subscribe also with an Action<string> which only gets all items
that of type string. Then there is also the question if this bus than
should have and default executor which can be overwritten if need.

Steve

Mike Rettig

unread,
Jun 9, 2009, 11:01:24 AM6/9/09
to retla...@googlegroups.com
You should create many typed channels. Using a single channel creates a central bottleneck in your system.  With a single channel, how do you differentiate between two different messages that are of type String?

public class SystemChannels{

public IChannel<string> hello = new Channel<string>();
public IChannel<string> bye = new Channel<string>();

}

Channels create explicit interfaces for asynchronous components. 

Mike

Steve Wagner

unread,
Jun 9, 2009, 11:07:26 AM6/9/09
to retla...@googlegroups.com
No the idea is to use more concrete messages with this channel instead
of values types like:

class HelloMessage{....}
class ByMessage{...}

-Steve

Mike Rettig schrieb:

Mike Rettig

unread,
Jun 9, 2009, 12:11:36 PM6/9/09
to retla...@googlegroups.com
Why not just use multiple channels?

var hello = new Channel<HelloMessage>();
var bye = new Channel<ByeMessage>();

That scales a lot better than using a single channel then filtering by type.

Retlang originally was designed with a central message bus, but in practice using individual channels proved to be more scalable in terms of raw performance and system design.

Mike

Steve Wagner

unread,
Jun 10, 2009, 5:23:55 AM6/10/09
to retla...@googlegroups.com
Ok you are right, i should try it.

The most architectures i see currently, are with one messagebus. I think
Retlang needs a sample how an modern application with IoC could manage
multiple channels. Something like 2 simple data classes which pup
messages to the ui. If you like, i could help create some.

Did you noticed the CreateAndStart thread?

-Steve

Mike Rettig schrieb:

Steve Wagner

unread,
Jun 25, 2009, 4:13:26 PM6/25/09
to retla...@googlegroups.com
Hi Mike, after some time of playing with it, ive completely dropped the
one local bus concept, start having fun and i am now totally impressed
how easy parallel processing with Retlang is.

Really good work Mike!

Are you have future plans with Retlang?

Steve

Steve Wagner schrieb:
Reply all
Reply to author
Forward
0 new messages