Liking cljdoc? Tell your friends :D

idem.protocol

Defines the core protocols for the IDEM library. These protocols abstract the underlying storage and messaging technologies, allowing for pluggable implementations (e.g., PostgreSQL, MySQL, Redis, Kafka).

Defines the core protocols for the IDEM library.
These protocols abstract the underlying storage and messaging technologies,
allowing for pluggable implementations (e.g., PostgreSQL, MySQL, Redis, Kafka).
raw docstring

DispatcherStorecljprotocol

Abstraction for the Dispatcher to claim and update outbox events.

Abstraction for the Dispatcher to claim and update outbox events.

claim-batch!clj

(claim-batch! this batch-size opts)

Claims a batch of pending (or retriable) events. Should handle concurrency safely (e.g., SELECT ... FOR UPDATE SKIP LOCKED).

Parameters: batch-size - Maximum number of events to fetch. opts - Implementation-specific options.

Returns: A sequence of event maps.

Claims a batch of pending (or retriable) events.
Should handle concurrency safely (e.g., SELECT ... FOR UPDATE SKIP LOCKED).

Parameters:
  batch-size - Maximum number of events to fetch.
  opts       - Implementation-specific options.

Returns:
  A sequence of event maps.

mark-outbox-failed!clj

(mark-outbox-failed! this event-id error-msg attempt-count opts)

Marks a specific event as failed. Depending on implementation, this might schedule a retry or mark as dead.

Marks a specific event as failed.
Depending on implementation, this might schedule a retry or mark as dead.

mark-outbox-sent!clj

(mark-outbox-sent! this event-id)

Marks a specific event as successfully sent.

Marks a specific event as successfully sent.
sourceraw docstring

fn->publisherclj

(fn->publisher f)

Adapts a simple function (fn [event] ...) into a Publisher.

Adapts a simple function (fn [event] ...) into a Publisher.
sourceraw docstring

InboxStorecljprotocol

Abstraction for idempotency and lease management.

Abstraction for idempotency and lease management.

acquire-lock!clj

(acquire-lock! this consumer-group msg-id ttl-ms)

Attempts to acquire a processing lock (lease) for a message.

Should return true if:

  1. The message is seen for the first time.
  2. The message was seen but the previous lease expired (takeover).

Parameters: consumer-group - Identifier for the consumer group. msg-id - Unique message identifier. ttl-ms - Time-to-live for the lease in milliseconds.

Returns: true if lock acquired, false otherwise.

Attempts to acquire a processing lock (lease) for a message.

Should return true if:
1. The message is seen for the first time.
2. The message was seen but the previous lease expired (takeover).

Parameters:
  consumer-group - Identifier for the consumer group.
  msg-id         - Unique message identifier.
  ttl-ms         - Time-to-live for the lease in milliseconds.

Returns:
  true if lock acquired, false otherwise.

mark-inbox-failed!clj

(mark-inbox-failed! this consumer-group msg-id error-msg)

Marks the message processing as failed.

Marks the message processing as failed.

mark-inbox-processed!clj

(mark-inbox-processed! this consumer-group msg-id)

Marks the message as successfully processed (permanently).

Marks the message as successfully processed (permanently).
sourceraw docstring

OutboxStorecljprotocol

Abstraction for persisting events within a business transaction.

Abstraction for persisting events within a business transaction.

emit!clj

(emit! this tx event-map)

Persists an event to the outbox storage.

Parameters: tx - The transaction context (e.g., java.sql.Connection, Hibernate Session). event-map - A map containing event details: {:aggregate-type String :aggregate-id String :event-type String :payload Map :headers Map (optional)}

Returns: A map containing the generated {:event-id ...}

Persists an event to the outbox storage.

Parameters:
  tx        - The transaction context (e.g., java.sql.Connection, Hibernate Session).
  event-map - A map containing event details:
              {:aggregate-type String
               :aggregate-id   String
               :event-type     String
               :payload        Map
               :headers        Map (optional)}

Returns:
  A map containing the generated {:event-id ...}
sourceraw docstring

Publishercljprotocol

Abstraction for the messaging system transport (e.g., Kafka, HTTP).

Abstraction for the messaging system transport (e.g., Kafka, HTTP).

publish!clj

(publish! this event)

Publishes a single event.

Parameters: event - The event map from the OutboxStore.

Returns: Implementation dependent (e.g., future, promise, or nil).

Publishes a single event.

Parameters:
  event - The event map from the OutboxStore.

Returns:
  Implementation dependent (e.g., future, promise, or nil).

start!clj

(start! this)

Lifecycle: Start the publisher (e.g., open connections).

Lifecycle: Start the publisher (e.g., open connections).

stop!clj

(stop! this)

Lifecycle: Stop the publisher (e.g., close connections).

Lifecycle: Stop the publisher (e.g., close connections).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close