andalera / retlang

Automatically exported from code.google.com/p/retlang
0 stars 3 forks source link

IChannel and IQueueChannel are incompatible #10

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It is impossible to create generic code that use interfaces and then decide to 
use the event model (Channel) or queue model (QueueChannel) later.

Proposal: drop the IQueueChannel interface altogether and have QueueChannel 
implement IChannel.

Alternative Proposal: have IQueueChannel be the base interface and IChannel 
inherit from that.

IQueueChannel has two methods and no sub-interfaces:
* void Publish(T message)
* IDisposable Subscribe(IExecutionContext, Action<T>)

IChannel has the same two methods (note: IExecutionContext is an IFiber in this 
case, but IFiber is an IExecutionContext) along with a set of other 
subscription models.  There is no reason why there has to be the separation.

Original issue reported on code.google.com by blorit...@gmail.com on 22 Mar 2011 at 5:20

GoogleCodeExporter commented 9 years ago
Not sure on this one.  

1) QueueChannel doesn't support many of the methods on IChannel.
2) Not sure how I feel about having IChannel implement IQueueChannel.  Perhaps 
if we came up with better names?

Original comment by graham.m...@gmail.com on 22 Mar 2011 at 7:05