Example #1
0
 public void OnNext(ISuspendedTask value)
 {
     // Submit a second Task once the first Task has been successfully suspended
     // on the same context as the first task.
     Logger.Log(Level.Warning, SuspendValidationMessage);
     value.ActiveContext.SubmitTask(GetTaskConfiguration());
 }
            public void OnNext(ISuspendedTask value)
            {
                if (_firstTask)
                {
                    // Submit a second Task once the first Task has been successfully suspended
                    // on the same context as the first task.
                    Logger.Log(Level.Warning, SuspendValidationMessage);
                    value.ActiveContext.SubmitTask(GetTaskConfiguration());
                }

                // after this we'll get more RunningTask events which have to be ignored
                _firstTask = false;
            }
Example #3
0
 public void OnNext(ISuspendedTask suspendedTask)
 {
     CheckMsgOrder(suspendedTask);
     _state = DriverState.Resume;
     try
     {
         suspendedTask.ActiveContext.SubmitTask(TaskConfiguration.ConfigurationModule
                                                .Set(TaskConfiguration.Identifier, suspendedTask.Id + "_RESUMED")
                                                .Set(TaskConfiguration.Task, GenericType <NoopTask> .Class)
                                                .Set(TaskConfiguration.OnMessage, GenericType <NoopTask> .Class)
                                                .Set(TaskConfiguration.OnSuspend, GenericType <NoopTask> .Class)
                                                .Set(TaskConfiguration.OnClose, GenericType <NoopTask> .Class)
                                                .Set(TaskConfiguration.OnTaskStop, GenericType <NoopTask> .Class)
                                                .Set(TaskConfiguration.OnSendMessage, GenericType <NoopTask> .Class)
                                                .Set(TaskConfiguration.Memento, ByteUtilities.ByteArraysToString(HelloStringByteArray))
                                                .Build());
     }
     catch (BindException ex)
     {
         Log.Log(Level.Error, "Task configuration error", ex);
         throw new DriverSideFailure("Task configuration error", ex);
     }
 }
Example #4
0
 public async Task DispatchSuspendedTaskEvent(ISuspendedTask suspendedTask)
 {
     await DispatchAsync(_suspendedTaskDispatcher, suspendedTask);
 }