Show / Hide Table of Contents

    Interface IScheduler

    Interface that represents a scheduler.

    Namespace: Fibula.Scheduling.Contracts.Abstractions
    Assembly: Fibula.Scheduling.Contracts.dll
    Syntax
    public interface IScheduler

    Properties

    | Improve this Doc View Source

    CurrentTime

    Gets the current time.

    Declaration
    DateTimeOffset CurrentTime { get; }
    Property Value
    Type Description
    System.DateTimeOffset
    | Improve this Doc View Source

    QueueSize

    Gets the queue size of the scheduler.

    Declaration
    int QueueSize { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    CalculateTimeToFire(IEvent)

    Calculates the time left to fire a given event.

    Declaration
    TimeSpan CalculateTimeToFire(IEvent evt)
    Parameters
    Type Name Description
    IEvent evt

    The event to calculate against.

    Returns
    Type Description
    System.TimeSpan

    A System.TimeSpan representing the time left to fire, or System.TimeSpan.Zero.

    | Improve this Doc View Source

    CancelAllFor(UInt32, Type)

    Cancels all events attributed to the specified requestor.

    Declaration
    void CancelAllFor(uint requestorId, Type specificType = null)
    Parameters
    Type Name Description
    System.UInt32 requestorId

    The id of the requestor.

    System.Type specificType

    Optional. The type of event to remove. By default, it will remove all.

    | Improve this Doc View Source

    CancelEvent(IEvent)

    Cancels an event.

    Declaration
    bool CancelEvent(IEvent evt)
    Parameters
    Type Name Description
    IEvent evt

    The event to cancel.

    Returns
    Type Description
    System.Boolean

    True if the event is cancelled, false otherwise.

    | Improve this Doc View Source

    RunAsync(CancellationToken)

    Begins the scheduler's processing the queue and firing events.

    Declaration
    Task RunAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken

    A token to observe for cancellation.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous processing operation.

    | Improve this Doc View Source

    ScheduleEvent(IEvent, Nullable<TimeSpan>, Boolean)

    Schedules an event to be fired at the specified time.

    Declaration
    void ScheduleEvent(IEvent eventToSchedule, TimeSpan? delayTime = default(TimeSpan? ), bool scheduleAsync = false)
    Parameters
    Type Name Description
    IEvent eventToSchedule

    The event to schedule.

    System.Nullable<System.TimeSpan> delayTime

    Optional. The time delay after which the event should be fired. If left null, the event is scheduled to be fired ASAP.

    System.Boolean scheduleAsync

    Optional. A value indicating whether to schedule asynchronously or not.

    Events

    | Improve this Doc View Source

    EventFired

    Event fired when an event gets fired by the scheduler.

    Declaration
    event EventFiredDelegate EventFired
    Event Type
    Type Description
    EventFiredDelegate

    Extension Methods

    ObjectExtensions.YieldSingleItem<T>(T)
    ObjectExtensions.GetPropertyValue(Object, String)
    Validate.ThrowIfNull(Object, String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2018-2020 | The Fibula Project
    Generated using DocFX | Jose L. Nuñez de Caceres et al.