Arcadic.Changes.Event (Arcadic v0.7.0)

Copy Markdown View Source

A single change-feed delivery from Arcadic.Changes.

The subscriber receives {:arcadic_change, %Arcadic.Changes.Event{}} messages. change_type is :create, :update, or :delete for real record changes, plus two in-band control markers the consumer MUST act on:

  • :reconnected — the socket dropped and was re-established. ArcadeDB /ws has no replay, so any events in the gap are lost; reconcile database.
  • :overflow — the internal buffer overflowed and dropped the oldest events (a slow subscriber); reconcile. database is nil (the drop spans the subscription).

rid is record["@rid"], lifted for convenience.

Summary

Types

change_type()

@type change_type() :: :create | :update | :delete | :reconnected | :overflow

t()

@type t() :: %Arcadic.Changes.Event{
  change_type: change_type(),
  database: String.t() | nil,
  record: map() | nil,
  rid: String.t() | nil,
  type: String.t() | nil
}