using System;
namespace Implab {
///
/// Deferred result, usually used by asynchronous services as the service part of the promise.
///
public interface IDeferred {
void Resolve();
///
/// Reject the promise with the specified error.
///
/// The reason why the promise is rejected.
///
/// Some exceptions are treated in a special case:
/// is interpreted as call to method,
/// and is always unwrapped and its
/// is used as the reason to reject promise.
///
void Reject(Exception error);
///
/// Marks current instance as cencelled with the specified reason.
///
/// The reason for the operation cancellation,
/// if not specified the new will be created
void SetCancelled(Exception reason);
}
}