| 1 |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. |
| 2 |
|
| 3 |
using System.Reactive.Disposables; |
| 4 |
|
| 5 |
namespace System.Reactive.Concurrency |
| 6 |
{ |
| 7 |
/// <summary> |
| 8 |
/// Scheduler with support for starting long-running tasks. |
| 9 |
/// This type of scheduler can be used to run loops more efficiently instead of using recursive scheduling. |
| 10 |
/// </summary> |
| 11 |
public interface ISchedulerLongRunning |
| 12 |
{ |
| 13 |
/// <summary> |
| 14 |
/// Schedules a long-running piece of work. |
| 15 |
/// </summary> |
| 16 |
/// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam> |
| 17 |
/// <param name="state">State passed to the action to be executed.</param> |
| 18 |
/// <param name="action">Action to be executed.</param> |
| 19 |
/// <returns>The disposable object used to cancel the scheduled action (best effort).</returns> |
| 20 |
/// <remarks> |
| 21 |
/// <para><b>Notes to implementers</b></para> |
| 22 |
/// The returned disposable object should not prevent the work from starting, but only set the cancellation flag passed to the specified action. |
| 23 |
/// </remarks> |
| 24 |
IDisposable ScheduleLongRunning<TState>(TState state, Action<TState, ICancelable> action); |
| 25 |
} |
| 26 |
} |