Table of Contents

Interface IMessageScheduler

Namespace
Excalibur.Dispatch.Transport
Assembly
Excalibur.Dispatch.Transport.Abstractions.dll

Defines a service for scheduling messages to be delivered at a future time.

public interface IMessageScheduler
Extension Methods

Methods

CancelAsync(string, CancellationToken)

Cancels a scheduled message.

Task<bool> CancelAsync(string scheduleId, CancellationToken cancellationToken)

Parameters

scheduleId string

The schedule identifier.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>

True if the schedule was cancelled, false otherwise.

CancelScheduledMessageAsync(string, CancellationToken)

Cancels a scheduled message (void return for backward compatibility).

Task CancelScheduledMessageAsync(string scheduleId, CancellationToken cancellationToken)

Parameters

scheduleId string

The schedule identifier.

cancellationToken CancellationToken

The cancellation token.

Returns

Task

A task representing the asynchronous operation.

GetScheduleAsync(string, CancellationToken)

Gets information about a scheduled message.

Task<ScheduleInfo?> GetScheduleAsync(string scheduleId, CancellationToken cancellationToken)

Parameters

scheduleId string

The schedule identifier.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<ScheduleInfo>

The schedule information, or null if not found.

ScheduleAsync(IDispatchMessage, DateTimeOffset, CancellationToken)

Schedules a message to be delivered at the specified time.

Task<string> ScheduleAsync(IDispatchMessage message, DateTimeOffset scheduleTime, CancellationToken cancellationToken)

Parameters

message IDispatchMessage

The message to schedule.

scheduleTime DateTimeOffset

The time when the message should be delivered.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<string>

The schedule identifier.

ScheduleMessageAsync<T>(T, DateTimeOffset, CancellationToken)

Schedules a message to be delivered at the specified time using a generic type.

Task<string> ScheduleMessageAsync<T>(T message, DateTimeOffset scheduledTime, CancellationToken cancellationToken)

Parameters

message T

The message to schedule.

scheduledTime DateTimeOffset

The time when the message should be delivered.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<string>

The schedule identifier.

Type Parameters

T

The type of message to schedule.