예제 #1
0
 internal static async System.Threading.Tasks.Task<HotpatchRef> RunHotpatchWithTask(
     string api,
     string operation,
     string endpoint,
     string apiKey,
     string parametersAsJson)
 {
     var @ref = new HotpatchRef();
     @ref.Promise = null;
     @ref.SemaphoreAsync = new System.Threading.SemaphoreSlim(0);
     var handle = _clientConnect.CallApiHotpatch(
         api,
         operation,
         endpoint,
         apiKey,
         parametersAsJson);
     _runningHotpatches[handle] = @ref;
     await @ref.SemaphoreAsync.WaitAsync();
     return @ref;
 }
예제 #2
0
 internal static HiveMPPromise<HotpatchRef> RunHotpatchWithPromise(
     string api,
     string operation,
     string endpoint,
     string apiKey,
     string parametersAsJson)
 {
     var @ref = new HotpatchRef();
     @ref.Promise = new HiveMPPromise<HotpatchRef>((resolve, reject) =>
     {
         resolve(@ref);
     });
     var handle = _clientConnect.CallApiHotpatch(
         api,
         operation,
         endpoint,
         apiKey,
         parametersAsJson);
     _runningHotpatches[handle] = @ref;
     return @ref.Promise;
 }