Ah, while *subscribe *is fine, my above post talks of the *reply *case... need to read some code, it seems :)
On Mon, Apr 19, 2010 at 11:50 AM, Jan Limpens <[email protected]> wrote: > While it is dead simple to publish/send messages to a bus exposed via wcf, > has anyone ever tried to subscribe to it? > > while this makes the kinda-stateful comet connection between client and > server > > protected override void InitializeRuntime() > > { > this.AddServiceEndpoint( > > typeof(IStockService), > new PollingDuplexHttpBinding(), > > new Uri(_serviceBusUri)); > base.InitializeRuntime(); > } > > Then I'd could expose the bus like that: > > [ServiceContract] > public interface IServiceBusService > { > [OperationContract] > void Publish<T>(T message); > > [OperationContract] > void Subscribe<T>(Action<T> callback); // don't like that this > callback goes across the wire, while all i want is the type. this should star > at the client... > > } > > I wonder how to go on after that. How does the message find it's > subscriber? For instance if I > > _busSrv.Subscribe<GetSearchResultMessage>((e)=> > MessageBox.Show(string.Join(e.Result, ", "))) > _busSrv.Send(send a new SearchMessage(searchTerm: "rhino")) > > How would _busSrv be able to tell if a certain GetSearchResultMessage is > for a certain client? > > How could _busSrv add itself to the dictionary of GetSearchResultMessage > consumers, without implementing the interface > ConsumerOf<GetSearchResultMessage>? There are _many_ types of messages, and > I would want to avoid to have to write and maintain all that boilerplate > code... > > -- > Jan > -- Jan -- You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rhino-tools-dev?hl=en.
