示例#1
0
 public Task Execute()
 {
     if (Output.EventError != EventError.Success)
     {
         if (EventCenter.EnabledLog(LogType.Debug))
         {
             EventCenter.Log(LogType.Debug, $"{Input.Token} {EventDispatchProxy.Type.Name} proxy execute {Input.EventPath} error {(string)Output.Data[0]}");
         }
         ENException exception = new ENException((string)Output.Data[0]);
         exception.EventError = Output.EventError;
         CompletionSource.Error(exception);
     }
     else
     {
         if (EventCenter.EnabledLog(LogType.Debug))
         {
             EventCenter.Log(LogType.Debug, $"{Input.Token} {EventDispatchProxy.Type.Name} proxy execute {Input.EventPath} successed!");
         }
         if (Output.Data != null && Output.Data.Length > 0)
         {
             CompletionSource.Success(Output.Data[0]);
         }
         else
         {
             CompletionSource.Success(new object());
         }
     }
     return(Task.CompletedTask);
 }