StellaOps.Workflow.Signaling.Redis
Redis signal driver for the workflow engine: delivers wake messages when signals are stored. Install Installing Stella Ops packagesWorkflow downloads and signaturesnet10.01.0.1-20261118T121708Zdotnet add package StellaOps.
Namespaces
| Namespace | Types |
|---|---|
StellaOps. | 7 |
namespace StellaOps.Workflow.Signaling.Redis
| Type | Kind | Description |
|---|---|---|
RedisWorkflowSignalDriver | class | The Redis signal driver: it publishes a wake message on a Redis channel after the workflow changes commit, and claims the signals from the durable store when a wake arrives or the blocking wait ends. |
RedisWorkflowSignalDriverOptions | class | Settings of the Redis signal driver (Workflow). |
RedisWorkflowSignalingExtensions | class | Registers the Redis signal driver. |
RedisWorkflowSignalingRoutine | class | Dependency-injection routine of the Redis signal driver. |
RedisWorkflowWakeMessageSerializer | class | Writes and reads the wake messages of the Redis channel. |
RedisWorkflowWakeSubscription | class | The subscription to the Redis wake channel. |
WorkflowRedisHealthCheck | class | Reports whether the Redis wake signaling is connected. |
class RedisWorkflowSignalDriver
public sealed class RedisWorkflowSignalDriver : IWorkflowSignalDriver
The Redis signal driver: it publishes a wake message on a Redis channel after the workflow changes commit, and claims the signals from the durable store when a wake arrives or the blocking wait ends.
Parameters
connection: The Redis connection.Multiplexer signalClaimStore: Claims the stored signals.wakeSubscription: Receives the wake messages.driverOptions: The channel name and the blocking wait.
Members
| Member | Kind | Summary |
|---|---|---|
RedisWorkflowSignalDriver( | constructor | The Redis signal driver: it publishes a wake message on a Redis channel after the workflow changes commit, and claims the signals from the durable store when a wake arrives or the blocking wait ends. |
DispatchMode | property | When the engine tells the driver that a signal is available. |
DriverName | property | The driver name, as Workflow selects it. |
NotifySignalAvailableAsync( | method | Tells the consumers that a signal is available. |
ReceiveAsync( | method | Waits up to the driver’s blocking wait for a signal to claim. |
constructor RedisWorkflowSignalDriver(IConnectionMultiplexer, IWorkflowSignalClaimStore, RedisWorkflowWakeSubscription, IOptions<RedisWorkflowSignalDriverOptions>) #
RedisWorkflowSignalDriver(IConnectionMultiplexer, IWorkflowSignalClaimStore, RedisWorkflowWakeSubscription, IOptions<RedisWorkflowSignalDriverOptions>) #public RedisWorkflowSignalDriver(IConnectionMultiplexer connectionMultiplexer, IWorkflowSignalClaimStore signalClaimStore, RedisWorkflowWakeSubscription wakeSubscription, IOptions<RedisWorkflowSignalDriverOptions> driverOptions)
The Redis signal driver: it publishes a wake message on a Redis channel after the workflow changes commit, and claims the signals from the durable store when a wake arrives or the blocking wait ends.
Parameters
connection: The Redis connection.Multiplexer signalClaimStore: Claims the stored signals.wakeSubscription: Receives the wake messages.driverOptions: The channel name and the blocking wait.
property DispatchMode #
DispatchMode #public WorkflowSignalDriverDispatchMode DispatchMode { get; }
When the engine tells the driver that a signal is available.
property DriverName #
DriverName #public string DriverName { get; }
The driver name, as Workflow selects it.
method NotifySignalAvailableAsync(WorkflowSignalWakeNotification, CancellationToken) #
NotifySignalAvailableAsync(WorkflowSignalWakeNotification, CancellationToken) #public Task NotifySignalAvailableAsync(WorkflowSignalWakeNotification notification, CancellationToken cancellationToken = default)
Tells the consumers that a signal is available.
Parameters
notification: The available signal.cancellationToken: Cancels the operation.
Returns
A task that completes when the notification is sent.
method ReceiveAsync(string, CancellationToken) #
ReceiveAsync(string, CancellationToken) #public Task<IWorkflowSignalLease?> ReceiveAsync(string consumerName, CancellationToken cancellationToken = default)
Waits up to the driver’s blocking wait for a signal to claim.
Parameters
consumerName: The consumer.cancellationToken: Cancels the operation.
Returns
The lease of the claimed signal, or null when none arrives in time.
class RedisWorkflowSignalDriverOptions
public sealed class RedisWorkflowSignalDriverOptions
Settings of the Redis signal driver (Workflow).
Members
| Member | Kind | Summary |
|---|---|---|
RedisWorkflowSignalDriverOptions( | constructor | Creates an instance of Redis. |
SectionName | constant | The configuration section the options bind from: Workflow. |
BlockingWaitSeconds | property | How long a receive waits for a signal before it returns empty, in seconds; a value below 1 counts as 1. |
ChannelName | property | The Redis channel that announces new signals. |
constructor RedisWorkflowSignalDriverOptions() #
RedisWorkflowSignalDriverOptions() #public RedisWorkflowSignalDriverOptions()
Creates an instance of Redis.
constant SectionName #
SectionName #public const string SectionName = "WorkflowSignalDriver:Redis"
The configuration section the options bind from: Workflow.
property BlockingWaitSeconds #
BlockingWaitSeconds #public int BlockingWaitSeconds { get; set; }
How long a receive waits for a signal before it returns empty, in seconds; a value below 1 counts as 1. The default is 30.
property ChannelName #
ChannelName #public string ChannelName { get; set; }
The Redis channel that announces new signals. The default is stellaops:workflow:signals.
class RedisWorkflowSignalingExtensions
public static class RedisWorkflowSignalingExtensions
Registers the Redis signal driver.
Members
| Member | Kind | Summary |
|---|---|---|
AddWorkflowRedisSignaling( | extension method | Registers the Redis signal driver, bound from Workflow, when Workflow is Redis; otherwise it only records the driver module. |
extension method AddWorkflowRedisSignaling(IServiceCollection, IConfiguration) #
AddWorkflowRedisSignaling(IServiceCollection, IConfiguration) #public static IServiceCollection AddWorkflowRedisSignaling(this IServiceCollection services, IConfiguration configuration)
Registers the Redis signal driver, bound from Workflow, when Workflow is Redis; otherwise it only records the driver module.
Parameters
services: The service collection to add the services to.configuration: The host configuration.
Returns
The same service collection, for chaining.
class RedisWorkflowSignalingRoutine
public sealed class RedisWorkflowSignalingRoutine : IDependencyInjectionRoutine
Dependency-injection routine of the Redis signal driver. A host that loads this assembly as a plugin discovers the routine; it registers exactly what RedisWorkflowSignalingExtensions.registers. The host still provides the IConnection, as it does for a package reference.
Members
| Member | Kind | Summary |
|---|---|---|
RedisWorkflowSignalingRoutine( | constructor | Creates an instance of Redis. |
Register( | method | Registers what RedisWorkflowSignalingExtensions.registers. |
constructor RedisWorkflowSignalingRoutine() #
RedisWorkflowSignalingRoutine() #public RedisWorkflowSignalingRoutine()
Creates an instance of Redis.
method Register(IServiceCollection, IConfiguration) #
Register(IServiceCollection, IConfiguration) #public IServiceCollection Register(IServiceCollection services, IConfiguration configuration)
Registers what RedisWorkflowSignalingExtensions.registers.
Parameters
services: The service collection.configuration: The host configuration.
Returns
The same service collection.
class RedisWorkflowWakeMessageSerializer
public static class RedisWorkflowWakeMessageSerializer
Writes and reads the wake messages of the Redis channel.
Members
| Member | Kind | Summary |
|---|---|---|
Deserialize( | method | Reads a wake notification from JSON. |
Serialize( | method | Writes a wake notification as JSON. |
method Deserialize(string) #
Deserialize(string) #public static WorkflowSignalWakeNotification Deserialize(string payload)
Reads a wake notification from JSON.
Parameters
payload: The JSON message.
Returns
The notification.
Exceptions
Invalid: The message is JSON null.Operation Exception
method Serialize(WorkflowSignalWakeNotification) #
Serialize(WorkflowSignalWakeNotification) #public static string Serialize(WorkflowSignalWakeNotification notification)
Writes a wake notification as JSON.
Parameters
notification: The notification.
Returns
The JSON message.
class RedisWorkflowWakeSubscription
public sealed class RedisWorkflowWakeSubscription : IDisposable, IAsyncDisposable
The subscription to the Redis wake channel.
Parameters
connection: The Redis connection.Multiplexer driverOptions: The channel name.
Members
| Member | Kind | Summary |
|---|---|---|
RedisWorkflowWakeSubscription( | constructor | The subscription to the Redis wake channel. |
Dispose( | method | Unsubscribes from the channel. |
DisposeAsync( | method | Unsubscribes from the channel. |
WaitForNotificationAsync( | method | Waits for the next wake message, subscribing to the channel on first use. |
constructor RedisWorkflowWakeSubscription(IConnectionMultiplexer, IOptions<RedisWorkflowSignalDriverOptions>) #
RedisWorkflowWakeSubscription(IConnectionMultiplexer, IOptions<RedisWorkflowSignalDriverOptions>) #public RedisWorkflowWakeSubscription(IConnectionMultiplexer connectionMultiplexer, IOptions<RedisWorkflowSignalDriverOptions> driverOptions)
The subscription to the Redis wake channel.
Parameters
connection: The Redis connection.Multiplexer driverOptions: The channel name.
method Dispose() #
Dispose() #public void Dispose()
Unsubscribes from the channel.
method DisposeAsync() #
DisposeAsync() #public ValueTask DisposeAsync()
Unsubscribes from the channel.
Returns
A task that completes when the subscription is closed.
method WaitForNotificationAsync(TimeSpan, CancellationToken) #
WaitForNotificationAsync(TimeSpan, CancellationToken) #public Task<WorkflowSignalWakeNotification?> WaitForNotificationAsync(TimeSpan maxWait, CancellationToken cancellationToken = default)
Waits for the next wake message, subscribing to the channel on first use.
Parameters
maxWait: How long to wait.cancellationToken: Cancels the operation.
Returns
The notification, or null when none arrives in time.
class WorkflowRedisHealthCheck
public sealed class WorkflowRedisHealthCheck : IHealthCheck
Reports whether the Redis wake signaling is connected.
Parameters
connection: The Redis connection.Multiplexer
Members
| Member | Kind | Summary |
|---|---|---|
WorkflowRedisHealthCheck( | constructor | Reports whether the Redis wake signaling is connected. |
CheckHealthAsync( | method | Pings Redis: healthy with the latency when connected, unhealthy otherwise. |
constructor WorkflowRedisHealthCheck(IConnectionMultiplexer) #
WorkflowRedisHealthCheck(IConnectionMultiplexer) #public WorkflowRedisHealthCheck(IConnectionMultiplexer connectionMultiplexer)
Reports whether the Redis wake signaling is connected.
Parameters
connection: The Redis connection.Multiplexer
method CheckHealthAsync(HealthCheckContext, CancellationToken) #
CheckHealthAsync(HealthCheckContext, CancellationToken) #public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
Pings Redis: healthy with the latency when connected, unhealthy otherwise.
Parameters
context: The health check context.cancellationToken: Cancels the operation.
Returns
The health check result.