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; }
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; }