parallax_logging

async parallax_logging.log_parallax_event(redis, channel_id, kind, **fields)

Append one event to the channel’s parallax event log. # πŸ“ΌπŸ”ͺ

Best-effort by design: never raises, never blocks the reply path on failure. Each entry gets a unique id so identical payloads can’t collide inside the ZSET.

Parameters:
  • redis (Any) – Async Redis client (main DB). None is a silent no-op.

  • channel_id (str) – Channel scope for the log.

  • kind (str) – Event kind (see module docstring).

  • **fields (Any) – Arbitrary JSON-serializable event payload.

Return type:

None

async parallax_logging.read_parallax_events(redis, channel_id, count=20, kind='')

Read recent parallax events for a channel, newest first. # πŸ”

Parameters:
  • redis (Any) – Async Redis client. None returns an empty list.

  • channel_id (str) – Channel scope.

  • count (int) – Maximum events to return (after kind filtering).

  • kind (str) – Optional event-kind filter (exact match).

Return type:

list[dict[str, Any]]

Returns:

Parsed event dicts, newest first; empty on any failure.