View Source StepFlow.LiveWorkers (StepFlow v1.8.0)

The LiveWorkers context.

Summary

Functions

Returns an %Ecto.Changeset{} for tracking live worker changes.

Creates a Live Worker entry.

Deletes a LiveWorker.

Gets a single live worker by job ID

Gets a single live worker by job ID

Returns the list of Live Worker.

Functions

Link to this function

change_live_worker(live_worker)

View Source

Returns an %Ecto.Changeset{} for tracking live worker changes.

Examples

iex> change_live_worker(job)
%Ecto.Changeset{source: %LiveWorker{}}
Link to this function

create_live_worker(attrs \\ %{})

View Source

Creates a Live Worker entry.

Examples

iex> create_live_worker(%{field: value})
{:ok, %LiveWorker{}}

iex> create_live_worker(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

delete_live_worker(live_worker)

View Source

Deletes a LiveWorker.

Examples

iex> delete_live_worker(live_worker)
{:ok, %LiveWorker{}}

iex> delete_live_worker(live_worker)
{:error, %Ecto.Changeset{}}

Gets a single live worker by job ID

Examples

iex> get_by(%{"job_id" => 123})
%LiveWorker{}

iex> get_by(%{"job_id" => 456})
nil

Gets a single live worker by job ID

Examples

iex> get_by!(123)
%LiveWorker{}

iex> get_by!(456)
nil
Link to this function

list_live_workers(params \\ %{})

View Source

Returns the list of Live Worker.

Examples

iex> StepFlow.LiveWorkers.list_live_workers()
%{data: [], page: 0, size: 10, total: 0}
Link to this function

update_live_worker(live_worker, attrs)

View Source

Updates a live worker.

Examples

iex> update_live_worker(job, %{field: new_value})
{:ok, %LiveWorker{}}

iex> update_live_worker(job, %{field: bad_value})
{:error, %Ecto.Changeset{}}