void FirstCommandConsumer(IConsumeContext <FirstCommand> context, FirstCommand message) { ThreadUtil.Sleep(10.Milliseconds()); var response = new FirstResponse(message.CorrelationId); context.Respond(response); }
public static void UseCommand() { var firstCommand = new FirstCommand(1); var secondCommand = new SecondCommand(2); firstCommand.Execute(); secondCommand.Execute(); }
protected override void OnModelChanged() { NextCommand.RaiseCanExecuteChanged(); PreviousCommand.RaiseCanExecuteChanged(); FirstCommand.RaiseCanExecuteChanged(); LastCommand.RaiseCanExecuteChanged(); RaisePropertyChanged(nameof(TotalPages)); }
protected override async Task When() { var someCommand = new FirstCommand(); await Bus.Send(someCommand); await Timeout.WaitUntil(() => MethodCallCounter.AllReceivedMessages.Count() >= _numExpectedMessages); _dispatchContexts = TestInterceptor.DispatchContexts.ToArray(); _nimbusMessages = TestInterceptor.NimbusMessages.ToArray(); }
protected override async Task When() { var someCommand = new FirstCommand(); await Bus.Send(someCommand); await TimeSpan.FromSeconds(10).WaitUntil(() => MethodCallCounter.AllReceivedMessages.Count() >= _numExpectedMessages); _dispatchContexts = TestInterceptor.DispatchContexts.ToArray(); _brokeredMessages = TestInterceptor.BrokeredMessages.ToArray(); }
protected override async Task When() { var someCommand = new FirstCommand(); await Bus.Send(someCommand); await Timeout.WaitUntil(() => MethodCallCounter.AllReceivedMessages.Count() >= _numExpectedMessages); _dispatchContexts = TestInterceptor.DispatchContexts.ToArray(); _nimbusMessages = TestInterceptor.NimbusMessages.ToArray(); }
public void RunCommand() { var result = false; var sut = new FirstCommand(() => result = true); sut.Run(); Assert.True(result); }
protected override async Task When() { var someCommand = new FirstCommand(); await Bus.Send(someCommand); await TimeSpan.FromSeconds(10).WaitUntil(() => MethodCallCounter.AllReceivedMessages.Count() >= _numExpectedMessages); _dispatchContexts = TestInterceptor.DispatchContexts.ToArray(); _brokeredMessages = TestInterceptor.BrokeredMessages.ToArray(); }
public void Execute() { var message = new FirstCommand { MessageValue = Guid.NewGuid().ToString() }; log.Info("Send Message " + message.MessageValue); endpoint.Send(message) .GetAwaiter().GetResult(); }
private static Action <FirstCommand> FirstCommandConsumer(FirstCommand message) { return(command => { ThreadUtil.Sleep(10.Milliseconds()); var response = new FirstResponse(command.CorrelationId); CurrentMessage.Respond(response); }); }
Action <FirstCommand> FirstCommandConsumer(FirstCommand message) { return(command => { ThreadUtil.Sleep(10.Milliseconds()); var response = new FirstResponse(command.CorrelationId); LocalBus.Context().Respond(response); }); }
public long SendFirstCommandRequest(EntityId entityId, global::Improbable.Gdk.Tests.BlittableTypes.FirstCommandRequest payload, Action <FirstCommand.ReceivedResponse> callback, uint?timeoutMillis = null, bool allowShortCircuiting = false) { if (!IsValid()) { return(-1); } var ecsCommandRequestSender = entityManager.GetComponentData <CommandSenders.FirstCommand>(entity); var request = FirstCommand.CreateRequest(entityId, payload, timeoutMillis, allowShortCircuiting, callback); ecsCommandRequestSender.RequestsToSend.Add(request); return(request.RequestId); }
public long SendFirstCommandRequest(EntityId entityId, global::Improbable.Gdk.Tests.NonblittableTypes.FirstCommandRequest payload, uint?timeoutMillis = null, bool allowShortCircuiting = false, object context = null) { if (!VerifyNotDisposed()) { return(-1); } var ecsCommandRequestSender = entityManager.GetComponentData <CommandSenders.FirstCommand>(entity); var request = FirstCommand.CreateRequest(entityId, payload, timeoutMillis, allowShortCircuiting, context); ecsCommandRequestSender.RequestsToSend.Add(request); return(request.RequestId); }
private void Model_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { if (e.PropertyName == nameof(Model.MaximumRows) || e.PropertyName == nameof(Model.StartRowIndex) || e.PropertyName == nameof(Model.Count)) { OnPropertyChanged(nameof(CurrentPage)); OnPropertyChanged(nameof(CountOfPages)); OnPropertyChanged(nameof(StringCountOfPages)); FirstCommand.RiseCanExecute(); PreviousCommand.RiseCanExecute(); NextCommand.RiseCanExecute(); LastCommand.RiseCanExecute(); } }
static void Main(string[] args) { SetupContainer(IoC.Container); Console.WriteLine("hello world"); FirstCommand command = new FirstCommand() { FirstRefenceProp = new FirstReference() { ReferenceIdentifier = "First" } }; IProcessCommands <FirstCommand> commandProcessor = IoC.Container.Resolve <IProcessCommands <FirstCommand> >(); commandProcessor.Process(command); Console.ReadKey(); }
public void SendResponse(global::Improbable.Gdk.Tests.BlittableTypes.FirstCommandResponse payload) { entityManager.GetComponentData <CommandResponders.FirstCommand>(entity).ResponsesToSend .Add(FirstCommand.CreateResponse(Request, payload)); }
private void FirstClick(object sender, EventArgs e) { FirstCommand?.Execute(null); }
public void Handle(FirstCommand command) { _eventAggregator.Publish(new CommandExecuted <FirstCommand>()); }
public void SendFirstCommandRequest(EntityId entityId, global::Generated.Improbable.Gdk.Tests.NonblittableTypes.FirstCommandRequest request) { var ecsCommandRequestSender = entityManager.GetComponentData <CommandSenders.FirstCommand>(entity); ecsCommandRequestSender.RequestsToSend.Add(FirstCommand.CreateRequest(entityId, request)); }
protected override async Task When() { var someCommand = new FirstCommand(); await Bus.Send(someCommand); await TimeSpan.FromSeconds(10).WaitUntil(() => MethodCallCounter.AllReceivedMessages.Any()); }
public CommandCompleted Handle(FirstCommand command) { _firstCommand = command; return(new CommandCompleted()); }
public CommandCompleted Handle(FirstCommand command) { return(new CommandFailed()); }
public CommandCompleted Handle(FirstCommand command) { return(new CommandSucceeded()); }
public void SendResponseFailure(string message) { entityManager.GetComponentData <CommandResponders.FirstCommand>(entity).ResponsesToSend .Add(FirstCommand.CreateResponseFailure(Request, message)); }