# `Wardrik.Events`

Operations on the events of every agent the scope can see.

    {:ok, cursor} = Wardrik.Events.head(scope)
    {:ok, stream} = Wardrik.Events.stream_list(scope, after: cursor)

# `head`

```elixir
@spec head(Wardrik.Scope.t(), term()) :: term() | :ok | {:error, Wardrik.Error.t()}
```

Read where the logs the patterns cover stand

`GET /v1/events/head`

# `list`

```elixir
@spec list(Wardrik.Scope.t(), term()) :: term() | :ok | {:error, Wardrik.Error.t()}
```

Read the events of the agents the patterns cover

A page reads after the cursor, from the start without one. A stream reads after the cursor, from what's written next without one. Where a log was trimmed past the cursor, a wardrik.events.dropped says so, and the log is read on from the oldest event it holds.

`GET /v1/events`

# `stream_list`

```elixir
@spec stream_list(Wardrik.Scope.t(), term()) ::
  {:ok, Enumerable.t()} | :ok | {:error, Wardrik.Error.t()}
```

Read the events of the agents the patterns cover, then follow new events as they arrive. Returns `{:ok, stream}` of `{%Wardrik.Event{}, cursor}` pairs.

A page reads after the cursor, from the start without one. A stream reads after the cursor, from what's written next without one. Where a log was trimmed past the cursor, a wardrik.events.dropped says so, and the log is read on from the oldest event it holds.

`GET /v1/events`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
