Client for communicating with the Sync channel from the Receiver's LiveView.
This module provides a simple interface for the Receiver to request data from the connected Sender through the channel.
Usage
# In Receiver LiveView, after sender connects:
# You receive {:sync, {:sender_joined, channel_pid}}
# Then request tables:
ref = ChannelClient.request_tables(channel_pid, self())
# Wait for {:sync_response, ref, {:ok, tables}} message
# Or use synchronous API:
{:ok, tables} = ChannelClient.fetch_tables(channel_pid)
Summary
Functions
Synchronously requests count and waits for response.
Synchronously requests records and waits for response.
Synchronously requests schema and waits for response.
Synchronously requests tables and waits for response.
Requests the record count for a specific table from the sender.
Requests paginated records from a specific table from the sender.
Requests the schema for a specific table from the sender.
Requests the list of available tables from the sender.
Functions
Synchronously requests count and waits for response.
Synchronously requests records and waits for response.
Synchronously requests schema and waits for response.
Synchronously requests tables and waits for response.
Requests the record count for a specific table from the sender.
Requests paginated records from a specific table from the sender.
Options
:offset- Starting offset (default: 0):limit- Maximum records to fetch (default: 100)
Requests the schema for a specific table from the sender.
Requests the list of available tables from the sender.
Returns the request ref. Response will be sent as:
{:sync_response, ref, {:ok, tables} | {:error, reason}}