Documentation
¶
Overview ¶
Package transaction coordinates PostgreSQL business writes with event delivery.
Index ¶
- type Handler
- type Store
- func (s *Store) Enqueue(ctx context.Context, tx *sql.Tx, stream string, message core.Envelope) error
- func (s *Store) FlushOne(ctx context.Context, runtime *core.Runtime) (bool, error)
- func (s *Store) Inbox(handler Handler) core.Handler
- func (s *Store) Migrate(ctx context.Context) error
- func (s *Store) Relay(ctx context.Context, runtime *core.Runtime, onError func(error)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
Store uses the same database and transactions as the application's business records.
func (*Store) Enqueue ¶
func (s *Store) Enqueue(ctx context.Context, tx *sql.Tx, stream string, message core.Envelope) error
Enqueue writes a prepared envelope into the caller's business transaction.
func (*Store) FlushOne ¶
FlushOne locks one pending row until persisted publication and commit complete. A crash between acknowledgement and commit can republish the same message ID.
func (*Store) Inbox ¶
Inbox prevents repeated database effects for one service subscription and message. External side effects still need their own idempotency keys.
Click to show internal directories.
Click to hide internal directories.