ArchAstro.Channels.ApiActivityFeed (archastro v0.2.0)

Copy Markdown

Phoenix channel for real-time activity feed updates.

Clients join a topic scoped to an agent or org and receive new_entry events as feed entries are created.

Topics

  • "api:activity_feed:agent:{agent_user_id}" — entries for a specific agent
  • "api:activity_feed:org:{org_id}" — entries for an entire org/tenant

Summary

Functions

join_agent(socket, agent_id)

@spec join_agent(GenServer.server(), String.t()) ::
  {:ok, ArchAstro.Channel.t()} | {:error, ArchAstro.Error.reason()}

join_org(socket, org_id)

@spec join_org(GenServer.server(), String.t()) ::
  {:ok, ArchAstro.Channel.t()} | {:error, ArchAstro.Error.reason()}

leave(channel)

@spec leave(ArchAstro.Channel.t()) :: :ok | {:error, ArchAstro.Error.reason()}

list_entries(channel, payload \\ %ArchAstro.Types.ChannelPayloads.ApiActivityFeedChannel.ListEntries.Input{}, timeout \\ 5000)

subscribe_new_entry(channel, subscriber \\ self())

@spec subscribe_new_entry(ArchAstro.Channel.t(), pid()) :: :ok