This repository was archived by the owner on May 12, 2026. It is now read-only.
Description Currently only EnqueueTopic is supported.
Proposal:
public interface ITopicPublisher
{
...
void ScheduleTopic < T > ( string topic , T data , TimeSpan delay ) ;
void ScheduleTopic < T > ( string topic , T data , DateTimeOffset enqueueAt ) ;
}
public class TopicPublisher : ITopicPublisher
{
...
public void ScheduleTopic < T > ( string topic , T data , TimeSpan delay )
{
BackgroundJob . Schedule ( ( ) => DispatchTopic ( topic , data ) , delay ) ;
}
public void ScheduleTopic < T > ( string topic , T data , DateTimeOffset enqueueAt )
{
BackgroundJob . Schedule ( ( ) => DispatchTopic ( topic , data ) , enqueueAt ) ;
}
}
Workaround:
Implement and use a new interface and implementation that inherit from "ITopicPublisher" and "TopicPublisher"
public interface ICustomTopicPublisher : ITopicPublisher
{
void ScheduleTopic < T > ( string topic , T data , TimeSpan delay ) ;
void ScheduleTopic < T > ( string topic , T data , DateTimeOffset enqueueAt ) ;
}
public class CustomTopicPublisher : TopicPublisher , ICustomTopicPublisher
{
public CustomTopicPublisher ( IServiceProvider serviceProvider ) : base ( serviceProvider )
{
}
public void ScheduleTopic < T > ( string topic , T data , TimeSpan delay )
{
BackgroundJob . Schedule ( ( ) => DispatchTopic ( topic , data ) , delay ) ;
}
public void ScheduleTopic < T > ( string topic , T data , DateTimeOffset enqueueAt )
{
BackgroundJob . Schedule ( ( ) => DispatchTopic ( topic , data ) , enqueueAt ) ;
}
}
public static class CustomTopicPublisherExtensions
{
public static void AddCustomTopicServices ( this IServiceCollection services )
{
services . AddTopicServices ( ) ;
services . AddScoped < ICustomTopicPublisher , CustomTopicPublisher > ( ) ;
}
} Reactions are currently unavailable
Currently only
EnqueueTopicis supported.Proposal:
Workaround:
Implement and use a new interface and implementation that inherit from "ITopicPublisher" and "TopicPublisher"