Releases
v0.1.42
Compare
Sorry, something went wrong.
No results found
Raezil
released this
26 Apr 18:48
Release Notes
GoEventBus v0.1.42 β 2025-04-26
π New Features
Transactional API
Added Transaction type on EventStore
BeginTransaction() to start buffering events
Publish(Event) on a Transaction to collect multiple events
Commit(ctx) atomically enqueues and immediately processes all buffered events, returning the first error (from subscribe or handler)
Rollback() to discard buffered events without side-effects
π§ͺ Testing
Unit tests covering:
Successful commit of multiple events
Rollback semantics (no events processed)
Partial-failure handling (handler errors abort the transaction)
Benchmarks for 16-event transactions under both sync and async modes to measure throughput and latency
βοΈ Internals & Improvements
Synchronous commit now processes events in-ring (bypassing external es.Publish) to ensure atomicity
First handler error aborts remaining work and advances tail to drop unprocessed entries
Transaction buffer cleared after commit, avoiding duplicate dispatch
π Migration Notes
Replace manual enqueuing + es.Publish() with:
tx := es .BeginTransaction ()
// β¦ tx.Publish(β¦)
err := tx .Commit (ctx )
You canβt perform that action at this time.