public void LookAt(PublishToken token) { foreach (var s in token.Subscriptions) { s.Push(token.Message); } }
public void LookAt(PublishToken token) { var tasks = token.Subscriptions.Select(s => _taskMaker.StartNew(() => s.Push(token.Message))).ToArray(); Task.WaitAll(tasks); tasks.PublishExceptionMessages(bus); }
public void LookAt(PublishToken token) { for (var i = 0; i <= _pipelineMembers.Count - 1; i++) { if (token.Cancel) break; _pipelineMembers[i].LookAt(token); } }
public void LookAt(PublishToken token) { for (var i = 0; i <= _pipelineMembers.Count - 1; i++) { if (token.Cancel) { break; } _pipelineMembers[i].LookAt(token); } }
public void LookAt(PublishToken token) { var tasks = token.Subscriptions.Select(s => taskMaker.StartNew(() => s.Push(token.Message))).ToArray(); if (tasks.Length == 0) return; taskMaker.ContinueWhenAll(tasks, ts => { //TODO: How to catch this exception? Seems to go to Nirvana... if (token.Message is ExceptionOccurred && ts.Any(t=>t.IsFaulted)) throw new MemBusException("Possible infinite messaging cycle since handling ExceptionOccurred has produced unhandled exceptions!"); ts.PublishExceptionMessages(bus); }); }
public void LookAt(PublishToken token) { var info = new MessageInfo(token.Message); for (int i = _pipelines.Count - 1; i >= 0; i--) //Backwards as we keep the default at index 0 { if (!_pipelines[i].Handles(info)) { continue; } _pipelines[i].LookAt(token); break; } }
public void LookAt(PublishToken token) { var message = (ActivateViewModelMsg)token.Message; // Sometimes objects that are bound to WPF and are created not on the dispatcher thread throw exceptions // hence we ensure that viewmodels are created on said dispatcher thread _dispatchServices.EnsureActionOnDispatcher( () => { var obj = _container.With(message).GetInstance(message.ViewModelType); if (obj == null) // SM could not instantiate the type for whatever reason return; message.SetInstantiatedModel(obj); }); }
public void publishes_message_fire_and_forget() { var p = new ParallelNonBlockingPublisher(); var evtBlock = new ManualResetEvent(false); var evtSignal = new ManualResetEvent(false); var evtSignal2 = new ManualResetEvent(false); var lockingSub = new MockSubscription<MessageA>(evtBlock, evtSignal); var runThroughSub = new MockSubscription<MessageA>(evtSignal:evtSignal2); var token = new PublishToken(new MessageA(), new[] { lockingSub, runThroughSub }); p.LookAt(token); lockingSub.Received.ShouldBeEqualTo(0); evtSignal2.WaitOne(); runThroughSub.Received.ShouldBeEqualTo(1); evtBlock.Set(); evtSignal.WaitOne(); lockingSub.Received.ShouldBeEqualTo(1); }
public void LookAt(PublishToken token) { var tasks = token.Subscriptions.Select(s => taskMaker.StartNew(() => s.Push(token.Message))).ToArray(); if (tasks.Length == 0) { return; } taskMaker.ContinueWhenAll(tasks, ts => { //TODO: How to catch this exception? Seems to go to Nirvana... if (token.Message is ExceptionOccurred && ts.Any(t => t.IsFaulted)) { throw new MemBusException("Possible infinite messaging cycle since handling ExceptionOccurred has produced unhandled exceptions!"); } ts.PublishExceptionMessages(_bus); }); }
public void LookAt(PublishToken token) { var tasks = token.Subscriptions.Select(s => _taskMaker.StartNew(() => s.Push(token.Message))).ToArray(); Task.WaitAll(tasks); tasks.PublishExceptionMessages(_bus); }
private static void publisherCheck(IPublishPipelineMember p) { var token = new PublishToken(new MessageA(), new[] { new MockSubscription<MessageA>(), new MockSubscription<MessageA>() }); p.LookAt(token); token.Subscriptions.OfType<MockSubscription<MessageA>>().All(s=>s.Received == 1).ShouldBeTrue(); }
public void LookAt(PublishToken token) { _bus.Publish(_message); }
#pragma warning disable 1998 //This is just a route through method, so it's OK if this part does run synchronously public async Task LookAtAsync(PublishToken token) { await Task.Run(() => LookAt(token)); }
public void LookAt(PublishToken token) { token.Subscriptions.Select(s => _taskMaker.StartNew(() => s.Push(token.Message))).ToArray(); }
public async Task LookAtAsync(PublishToken token) { IAsyncPublishPipelineMember publisher = new SequentialPublisher(); await publisher.LookAtAsync(token); }
void IPublishPipelineMember.LookAt(PublishToken token) { var member = _actualPipelineMember(); member.LookAt(token); }
public void LookAt(PublishToken token) { foreach (var s in token.Subscriptions) s.Push(token.Message); }