public Task <IWaitResult> SendToProcessManagers(DomainEvent message, IMessageMetadata metadata = null) { var task = _waiter.Start(); _commandPipe.ProcessesPipeActor.Tell(new MessageMetadataEnvelop <DomainEvent>(message, metadata ?? MessageMetadata.Empty)); return(task); }
public async Task <IWaitResults> Publish(object message, IMessageMetadata metadata = null) { var task = _waiter.Start(); _publisher.Publish(message, metadata ?? MessageMetadata.Empty()); return(await task); }
public AkkaWaiter_message_test_filtered_message() { _transport = new LocalAkkaEventBusTransport(Sys); var waiter = new LocalMessagesWaiter(Sys, _transport, TimeSpan.FromSeconds(2)); waiter.Expect <string>(m => m.Like("Msg")); _results = waiter.Start(TimeSpan.FromSeconds(10)); }
//Given_waiter_subscribed_for_message_When_publishing_message() public AkkaWaiter_One_Message_Test() { var actorSystem = TestActorSystem.Create(); var transport = new LocalAkkaEventBusTransport(actorSystem); var waiter = new LocalMessagesWaiter(actorSystem, transport, TimeSpan.FromSeconds(10)); waiter.Expect <string>(); _results = waiter.Start(TimeSpan.FromSeconds(10)); _testmsg = "TestMsg"; transport.Publish(_testmsg, MessageMetadata.Empty); }