Skip to content

Introduction ​

PulseSharp is a small .NET library for two things almost every app needs:

  • Events - something happened (SaleCompleted, OrderShipped). PulseSharp saves the event first, then delivers it to every handler that cares about it.
  • Jobs - work to do (ImportProducts, ExportReport). PulseSharp saves the job, runs it once with a single handler, and reports its progress.

Why PulseSharp? ​

LightweightPulseSharp.Abstractions has no dependencies. The engine uses only the Microsoft.Extensions.*.Abstractions packages. Everything else is opt-in.
DurableAn event or job is stored before Emit / Enqueue returns. Handlers that fail are retried; nothing is silently dropped.
OrderedEvents of one stream reach each handler in order. Different streams are handled in parallel.
Isolated failuresA failing event stops only its own stream, and only for that handler. Every other stream and handler keeps flowing.
ControllableIPulseControl shows where every handler is and lets you retry, skip or rewind - and read, cancel or retry jobs.
Any appDesktop, web, worker or console. No ASP.NET Core in the core packages. Works with trimming and Native AOT.
HonestDelivery is at-least-once, and the docs say exactly what that means. See Delivery guarantees.

Events or jobs? ​

If…Use
something happened, and zero, one or many parts of your app may reactan event
specific work must be done once - maybe later, maybe with progressa job

They work together: an event handler can enqueue a job.

csharp
public sealed class StartDailyExport(IPulse pulse) : IEventHandler<DayClosed>
{
    public async Task Handle(DayClosed day, EventContext context, CancellationToken ct)
    {
        await pulse.Enqueue(new ExportReport(day.Date), ct);
    }
}

Packages ​

PackageWhat it addsStatus
PulseSharp.AbstractionsContracts for handlers and libraries. No dependencies.Preview
PulseSharpThe enginePreview
PulseSharp.SqliteSQLite store, for desktop and mobile appsPreview
PulseSharp.PostgreSqlPostgreSQL store, for servers and several app instancesPreview
PulseSharp.SyncDevice to cloud sync: the device side. See SyncPreview
PulseSharp.Sync.ServerDevice to cloud sync: the ASP.NET Core endpointPreview
PulseSharp.TestingTest helpers for your app. See Testing your appPreview
PulseSharp.MonitorOptional web UIPlanned (after 1.0)

Reference only the contracts from libraries

A class library that only defines events, jobs or handlers can reference PulseSharp.Abstractions alone. Only the app that runs them needs PulseSharp.

Next: Getting started.

Released under the MIT License.