Ingot.Progress (Ingot v0.1.0)

View Source

Manages broadcasting of progress updates via Phoenix PubSub.

This module provides functions to broadcast labeling events to all connected LiveView processes for real-time progress updates.

Summary

Functions

Broadcast that a label was completed.

Broadcast queue statistics update.

Broadcast that a user joined the labeling interface.

Broadcast that a user left the labeling interface.

Subscribe to all progress events.

Subscribe to label completion events.

Subscribe to queue updates.

Subscribe to user join/leave events.

Functions

broadcast_label_completed(session_id)

Broadcast that a label was completed.

Examples

iex> Progress.broadcast_label_completed("session-123")
:ok

broadcast_queue_update(stats)

Broadcast queue statistics update.

Examples

iex> Progress.broadcast_queue_update(%{remaining: 453})
:ok

broadcast_user_joined(user_id)

Broadcast that a user joined the labeling interface.

Examples

iex> Progress.broadcast_user_joined("user-123")
:ok

broadcast_user_left(user_id)

Broadcast that a user left the labeling interface.

Examples

iex> Progress.broadcast_user_left("user-123")
:ok

subscribe_all()

Subscribe to all progress events.

subscribe_labels()

Subscribe to label completion events.

subscribe_queue()

Subscribe to queue updates.

subscribe_users()

Subscribe to user join/leave events.