コード例 #1
0
 private NativeCommon.IFabricAsyncOperationContext GetRepairTaskListAsyncBeginWrapper(
     RepairTaskQueryDescription queryDescription,
     TimeSpan timeout,
     NativeCommon.IFabricAsyncOperationCallback callback)
 {
     using (var pin = new PinCollection())
     {
         return(this.nativeRepairClient.BeginGetRepairTaskList(
                    queryDescription.ToNative(pin),
                    Utility.ToMilliseconds(timeout, "timeout"),
                    callback));
     }
 }
コード例 #2
0
            /// <summary>
            /// <para>Gets a list of repair tasks matching all of the given filters.</para>
            /// </summary>
            /// <param name="taskIdFilter">
            /// <para>The repair task ID prefix to be matched.  If null, no filter is applied to the task ID.</para>
            /// </param>
            /// <param name="stateFilter">
            /// <para>A bitwise combination of state filter values that specify which task states should be included in the list.</para>
            /// </param>
            /// <param name="executorFilter">
            /// <para>The name of the repair executor whose claimed tasks should be included in the list. If null, no filter is applied to the executor name.</para>
            /// </param>
            /// <param name="timeout">
            /// <para>The maximum amount of time Service Fabric will allow this operation to continue before returning a <see cref="System.TimeoutException" />.</para>
            /// </param>
            /// <param name="cancellationToken">
            /// <para>The optional cancellation token that the operation is observing. It can be used to send a notification that the operation should be canceled. Note that cancellation is advisory and that the operation may still be completed even if it is cancelled.</para>
            /// </param>
            /// <returns>
            /// <para>The list of repair tasks matching all of the given filters.</para>
            /// </returns>
            public Task <RepairTaskList> GetRepairTaskListAsync(
                string taskIdFilter,
                RepairTaskStateFilter stateFilter,
                string executorFilter,
                TimeSpan timeout,
                CancellationToken cancellationToken)
            {
                this.fabricClient.ThrowIfDisposed();
                var queryDescription = new RepairTaskQueryDescription(
                    DefaultScope,
                    taskIdFilter,
                    stateFilter,
                    executorFilter);

                return(Utility.WrapNativeAsyncInvokeInMTA <RepairTaskList>(
                           callback => this.GetRepairTaskListAsyncBeginWrapper(queryDescription, timeout, callback),
                           this.GetRepairTaskListAsyncEndWrapper,
                           cancellationToken,
                           "RepairManagementClient.GetRepairTaskListAsync"));
            }