Releases
v0.1.42
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.