Changelog
All notable changes to PulseSharp are listed here. The format follows Keep a Changelog, and versions follow Semantic Versioning.
Unreleased
0.8.0-alpha - 2026-10-31
One way to do each thing, before a real app is built on PulseSharp.
Changed
- Breaking: one way to set PulseSharp up:
services.AddPulseSharp(pulse => pulse.UseSqlite("app.db")), orUsePostgreSql(…)orUseStore(…).AddPulseSharpSqlite,AddPulseSharpPostgreSqlandAddPulseSharpInMemoryare removed. Sync is set up withUseSync(sync => …)only;SyncWithCloudis removed. - Breaking: one way per kind of handler, all of them safe for trimming and Native AOT:
On<TEvent>(name, (event, context, ct) => …),AddHandler<TEvent, THandler>(),OnJob<TJob>((job, context, ct) => …)andAddJobHandler<TJob, THandler>(). Removed:When,OnJobwithout the context and the token, andAddHandler<THandler>()andAddHandlersFromAssembly, which found handlers by reflection. A class that handles several event types is added once per event type. - Breaking: the in-memory store moved to
PulseSharp.Testing(pulse.UseInMemory()), so an app can never lose its events by choosing it by mistake.AddPulseSharpwithout a store stops at startup and says how to choose one. samples/ConsoleSampleandsamples/PosSynckeep their data in SQLite.- Docs: every page checked against the current API, and every code example compiled. The architecture page no longer promises tracing, metrics or failure hooks that are not built yet (they are planned), and the API reference no longer lists a private method.
Tested
- Upgrades: a SQLite and a PostgreSQL database made by the published
0.4.0-alphaopen with the current version. Handled events are not delivered again, a stream carries on at the next position, a stopped handler stays stopped until it is retried, a waiting job runs, and the newer tables are added.
0.7.0-alpha - 2026-10-24
A round of hardening found by building a complete example shop (a cloud API and desktop tills), then a round of simplifying: much faster delivery, handlers and jobs that heal when stuck or after a crash, a limit on what devices may write, and events that can be saved together.
Added
pulse.EmitAll(stream, events): saves several events to one stream in one commit, all or none, in the order given. It is also much faster than emitting one by one (on one machine, 5,000 events: 1,404 to 13,731 per second on SQLite, 411 to 14,190 on PostgreSQL, in groups of 100). Works withEmitOptions(the expected version and the transaction apply to the whole group) and inFakePulseandPulseTestHost.IPulsehas two new methods, so a class that implementsIPulsemust add them.- Store authors:
IPulseStore.AppendAll(events, expectedVersion, transaction), with conformance tests. Advanced.HandlerTimeout(5 minutes) andAdvanced.JobTimeout(1 hour): a handler or job that takes longer is cancelled, and abandoned when it does not stop within 10 poll intervals. The attempt counts as failed ("took longer than ... raise Advanced.HandlerTimeout") and is retried as usual, so a hanging handler can no longer block its stream for good.nullsets no limit.- Sync server:
server.PushStreams(node => [...])says which streams each device may write, andserver.PushAnyStream()allows all. An event for another stream is refused (the server logs a warning, the device logs one too), the device's other events are saved, and a refused event never blocks the ones behind it. - Sync status:
SyncStatus.Waiting(how many events the server has not confirmed, also after a restart that starts offline) andIPulseSync.StatusChanged, so a screen needs no polling. Store authors:ISyncStore.CountForSync. - Sync sends a saved event at once while online (a short wait gathers a burst), and events received from the server wake the handlers at once. While the server cannot be reached, sync still backs off.
Changed
- Breaking:
UseSyncServermust say which streams devices may write:PushStreams(...)orPushAnyStream(). The app stops at startup with a message when neither is there, so a device can never write into the server's own streams by accident. - Faster recovery after a crash: another instance, or the restarted app, takes over a handler after 10 seconds (it was 30) and a running job after 30 seconds (it was 5 minutes). Breaking:
Advanced.HandlerLeaseandAdvanced.JobLeaseare gone. A lease is renewed every poll interval, so it now followsPollInterval: 10 poll intervals for a handler and 30 for a job, at least 10 and 30 seconds. - Docs: the events guide explains that every stream keeps a cursor per handler for good, and shows a stream per till and day for high volumes. The sync guide says what the server checks. The stores guide explains that events are kept for good, like in event sourcing. The API reference no longer lists internal types.
Faster
- A handler saves its progress in groups, one commit for all the streams it works on (after at most 100 handled events or 200 ms, at the end of every round, when an event fails, and when the app stops normally), instead of one commit per event. On one machine, with a handler that does nothing: a backlog in one stream goes from 1,339 to over 27,000 events per second on SQLite and from 465 to over 12,000 on PostgreSQL; 5,000 streams of one event each go from 1,377 to over 18,000 per second on SQLite and from 1,505 to about 4,800 on PostgreSQL. After a crash, the events handled in the last moments (at most 100 per handler) can be delivered again, which the at-least-once rule already allows.
- Store authors:
IPulseStore.SaveCursors(cursors, revision)saves several cursors in one commit, with the same revision check asSaveCursor. Advanced.MaxParallelStreamsis now 8 by default (it was 4).
Fixed
- A handler could deliver events again after a retry, skip or rewind: when
IPulseControlchanged the handler at the moment an app instance picked it up, the instance could end up with fresh cursors tagged with an old revision, so its first progress save was refused and it started over. The revision is now checked again after the cursors are loaded. - Sync: when the server refused a push, the device also stopped receiving, because the pull ran only after a successful push. Push and pull now run independently, so a problem in one direction no longer stops the other. The status still reports the error.
- Sync status: right after a successful sync, the status could briefly go back to the previous "offline" value, and
SyncNowcould return the result of a later background run instead of its own. Both are fixed.
Tested
- Lost connections during sync: a lost answer to a push (also in the middle of a large backlog), a lost answer to a pull, and an error returned after the server saved the events. Nothing is lost and nothing is handled twice.
- A real app process killed in the middle of a handler and of a job, on SQLite and PostgreSQL: the next app carries on in order, loses nothing, and the killed job runs again as a new attempt.
- The PostgreSQL database taken away while the app runs (every connection cut, new ones refused for a while): the app carries on by itself when the database is back.
0.6.0-alpha - 2026-10-20
Getting ready for 1.0: a consistent API, finished jobs cleaned up, instant wake-ups between PostgreSQL app instances, and the new PulseSharp.Testing package. Renames are listed old → new.
Added
services.AddPulseSharpInMemory(pulse => …): the in-memory store in one call, likeAddPulseSharpSqliteandAddPulseSharpPostgreSql.IPulseControl.RetryFailed(handlerName = null): tries every failed stream again at once, for one handler or all, and returns how many.- Finished jobs are cleaned up: jobs that succeeded or were cancelled are deleted 7 days after they finished (
pulse.Advanced.KeepFinishedJobs,nullkeeps every job). Failed jobs are kept until retried. The app instance that runs jobs does it about once an hour. - Store authors:
IPulseStore.DeleteFinishedJobs(finishedBefore, maxCount), with conformance tests. - PostgreSQL wakes other app instances at once: every saved event, job, retry and control change sends a
NOTIFYwhen its transaction commits (never for a rollback), and each instance listens on one extra connection, so handlers and jobs on other instances start right away instead of at the next poll. The listener reconnects on its own; polling stays as the safety net. - Store authors: optional
INotifyingStore.ListenForChanges(changed, cancellationToken)for stores that can tell other instances about new work. PulseSharp.Testing, a new package for test projects, for any test framework:FakePulse: anIPulsethat records what is emitted and enqueued (Events,Jobs), checks expected versions, and can fail on purpose (ThrowOnEmit,ThrowOnEnqueue). An open class you can derive from.- Checks as extension methods:
Emitted<T>(),Emitted<T>(stream),Emitted(event),Emitted<T>(e => …),NotEmitted<T>(),Enqueued…,NotEnqueued<T>(),AllEmitted<T>(),AllEnqueued<T>(). They return what they find, and a failing check shows everything that happened. Write your own onIRecordedPulse. handler.Handle(event)andjobHandler.Handle(job): call handlers without building a context; the job version returns aFakeJobContextwith the reported progress.PulseTestHost: the real engine in memory (or on any store) with your handlers and services;Given(...),WaitUntilIdle()(no delays in tests) andNothingFailed(). The same checks work on it.
Changed
UseSqliteandnew SqliteStore(…)accept a file name ("app.db") as well as a connection string, likeAddPulseSharpSqlite.- Breaking:
PostgresStore→PostgreSqlStore. - Breaking:
JobInfo.Id→JobInfo.JobId, and for store authorsStoredJob.Id→StoredJob.JobId, so a job's id has one name everywhere. - Breaking (store authors):
LeaseStatus→JobLeaseStatus, next toHandlerLeaseStatus. - Breaking: sync server
PullFilter(node => …)→PullStreams(node => …), the same word the device uses. - Breaking:
UseSyncServermoved to thePulseSharpnamespace, with every other method you call onpulse.MapPulseSharpSyncstays inMicrosoft.AspNetCore.Builder; theAddPulseSharp…methods stay inMicrosoft.Extensions.DependencyInjection.
0.5.0-alpha - 2026-10-15
Added
- A simpler way in, on top of the same engine:
services.AddPulseSharpSqlite("app.db", pulse => …)andservices.AddPulseSharpPostgreSql(connectionString, pulse => …)set PulseSharp up in one call.pulse.When<TEvent>(event => …)reacts to an event without a name, context or token. It is namedwhen-{EventName}; a secondWhenfor the same event stops the app at startup and asks for a name.pulse.OnJob<TJob>(async job => …)runs a job without a context or token.pulse.Emit(event)saves an event to the stream named after its type. A plain string now works as a stream name:pulse.Emit("Sale-" + id, sale).pulse.EnqueueIn(job, delay)andpulse.EnqueueAt(job, time).- One log line at startup:
PulseSharp is ready. Store: …, node: …, event handlers: …, job types: ….
- Device to cloud sync.
PulseSharp.Sync(the device side, no dependencies beyond PulseSharp):pulse.SyncWithCloud(server, apiKey), orpulse.UseSync(sync => …)withPullStreams,Push,Pull,Interval,BatchSize,AuthorizeandHttpHandler. Sends the events this node emitted and receives everyone else's, in resumable batches. Offline is normal: the wait grows up to a minute and sync catches up later.IPulseSyncshows the status and syncs on request (SyncNow).PulseSharp.Sync.Server(ASP.NET Core):pulse.UseSyncServer(server => …)withAllowNode(node, key, pullStreams),NodeFrom(user => …)andPullFilter(node => …), andapp.MapPulseSharpSync(). A node may only send its own events and only receive the streams it is allowed; it never gets its own events back.- Protocol version 1 over HTTP and JSON (
info,push,pull). samples/PosSync: two tills sell while the cloud is down, sync when it comes back, and receive a price change and an oversold warning.
PulseSharpBuilder.Services, so extension packages can register their services.- Store contract for sync:
ISyncStore(AppendReplicated,ReadForSync,LoadSyncPosition,SaveSyncPosition),SyncQueryandSyncDirection, implemented by the in-memory, SQLite and PostgreSQL stores. Replicated events keep their id, origin and time; an event already in the store is skipped. New conformance tests cover it.
Changed
- Breaking: the rarely changed settings moved to
pulse.Advanced:PollInterval,MaxParallelStreams,MaxParallelJobs,JobLease,HandlerLeaseandJsonOptions.Node,MaxAttemptsandRetryDelaystay onpulse. - The README on nuget.org is plain Markdown now (it showed raw HTML), with working links, and the packages' project website is the docs site.
- SQLite schema version 3 and PostgreSQL schema version 2 add a sync position table and an index on the event origin. They are applied on start.
0.4.0-alpha - 2026-10-13
Added
PulseSharp.PostgreSql:pulse.UsePostgreSql(connectionString, schema)(schemapulsesharpby default). Tables are created and upgraded on start under an advisory lock; event and job data is stored asjsonb; your ownNpgsqlTransactionsaves data and events or jobs together. Depends only on Npgsql.- Several app instances on one database: each handler is delivered by one instance at a time (a renewed lease,
HandlerLease, default 30 seconds); a stopped instance hands over at once, a crashed one after the lease. Jobs are claimed withFOR UPDATE SKIP LOCKED. - Store contract:
LeaseHandler,ReleaseHandler,ChangeCursors,ReadStream,HandlerLeaseStatus, andSaveCursorwith a revision. - Conformance tests now run against PostgreSQL too (in CI with a PostgreSQL service), plus multi-instance tests on SQLite and PostgreSQL. A PostgreSQL benchmark.
Changed
IPulseControlchanges (Retry,Skip,Rewind) go through the store and work from any app instance. They return when the change is stored; the instance holding the handler applies it within about one poll interval.- PostgreSQL appends run one transaction at a time per schema, so readers never skip an event that commits late.
0.3.0-alpha - 2026-10-11
Added
PulseSharp.Sqlite:pulse.UseSqlite(connectionString). Events, cursors and jobs survive a restart; tables (pulsesharp_*) are created and upgraded on start; WAL mode; atomic job claiming; your ownSqliteTransactionsaves data and events or jobs together.- The store contract is public:
IPulseStore(withInitialize),NewEvent,StoredEvent,NewJob,StoredJob,LeaseStatus, andPulseSharpBuilder.UseStore. PulseSharpBuilder.JsonOptions: events and jobs are stored as JSON (System.Text.Json); set a source-generated resolver for Native AOT.ExpectedVersion.Allows(currentPosition)for store authors.- A conformance test suite that runs against every store, and a SQLite benchmark.
Changed
- Events and jobs are serialized by the engine before they reach any store, including the in-memory store. A type that can't be serialized now fails at
Emit/Enqueue. - Store cursors use the public
HandlerCursortype.
Fixed
- A graceful shutdown right after a handler finished could skip saving its cursor, so the event was delivered again after a restart.
0.2.0-alpha - 2026-10-11
Added
- Jobs:
IPulse.Enqueuewith an optionalRunAt,OnJob<TJob>andAddJobHandler<TJob, THandler>, andAddHandler/AddHandlersFromAssemblyalso findIJobHandler<TJob>classes. A job type has exactly one handler. - Job retries with a growing delay up to
MaxAttempts, progress throughJobContext.Report, cooperative cancel,MaxParallelJobs(default 4), and leases (JobLease, default 5 minutes) renewed by a heartbeat. IPulseControl:GetJob,GetJobs,CancelJobandRetryJob, with the publicJobInfoandJobStatetypes.- The console sample exports a report as a job; a job benchmark.
Changed
IPulse.Enqueueno longer throwsNotSupportedException.
0.1.0-alpha - 2026-10-11
Added
IPulseControl:GetCursors,Retry,SkipandRewindfor handlers, with the publicHandlerCursorandCursorStatetypes.AddHandlersFromAssembly(assembly): adds every public or internal handler class of an assembly.MaxParallelStreams(default 4): a handler works on several streams at the same time; each stream stays in order.- A console sample and the first benchmarks.
0.0.1-alpha - 2026-10-11
First preview. Events only, with the in-memory store.
Added
PulseSharp.Abstractions:IPulse,IEventHandler<T>,EventContext,IJobHandler<T>,JobContext,StreamName,DailyStreamName,EmitOptions,ExpectedVersion,EmitResult,EnqueueOptions,ExpectedVersionMismatchException, and the[HandlerName],[EventName]and[JobName]attributes.PulseSharp:AddPulseSharp, the in-memory store,On<T>inline handlers,AddHandlerfor handler classes, in-order delivery per stream, retries with a growing delay, a per-stream stop afterMaxAttempts, startup checks for duplicate names, and UUIDv7 event ids.- Brand assets, build settings, CI and release workflows, and the vision and architecture documents.
Not yet available
IPulse.EnqueuethrowsNotSupportedException. Jobs arrive in 0.2.