Skip to content

Instantly share code, notes, and snippets.

@neuecc
Created June 3, 2021 16:08
Show Gist options
  • Save neuecc/963437866781034e595e216df2ea781c to your computer and use it in GitHub Desktop.
Save neuecc/963437866781034e595e216df2ea781c to your computer and use it in GitHub Desktop.
// keyless-sync
public interface IPublisher<TMessage>
{
void Publish(TMessage message);
}
public interface ISubscriber<TMessage>
{
IDisposable Subscribe(IMessageHandler<TMessage> handler, params MessageHandlerFilter<TMessage>[] filters);
}
// keyless-async
public interface IAsyncPublisher<TMessage>
{
ValueTask PublishAsync(TMessage message, AsyncPublishStrategy publishStrategy, CancellationToken cancellationToken = default(CancellationToken));
}
public interface IAsyncSubscriber<TMessage>
{
IDisposable Subscribe(IAsyncMessageHandler<TMessage> asyncHandler, params AsyncMessageHandlerFilter<TMessage>[] filters);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment