antikythera v0.2.0 AntikytheraCore.AsyncJob.Queue View Source
A queue-like data structure, replicated using RaftedValue
, to store AntikytheraCore.AsyncJob
structs.
Link to this section Summary
Functions
Type-aware getter for abandoned_jobs
Type-aware setter for abandoned_jobs
Type-aware getter for brokers_to_notify
Type-aware setter for brokers_to_notify
Type-aware getter for brokers_waiting
Type-aware setter for brokers_waiting
Type-aware getter for index_runnable
Type-aware setter for index_runnable
Type-aware getter for index_running
Type-aware setter for index_running
Type-aware getter for index_waiting
Type-aware setter for index_waiting
Type-aware getter for jobs
Type-aware setter for jobs
Creates a new instance of AntikytheraCore.AsyncJob.Queue by using the given dict
A variant of new/1
which returns t
or raise if validation fails
Updates an existing instance of AntikytheraCore.AsyncJob.Queue with the given dict
.
The values in the dict
are validated by each field’s valid?/1
function.
Returns {:ok, valid_struct}
or {:error, reason}
A variant of update/2
which returns t
or raise if validation fails.
In other words, update/2
followed by Croma.Result.get!/1
Checks if the given value belongs to t/0
or not
Link to this section Types
t() :: %AntikytheraCore.AsyncJob.Queue{abandoned_jobs: Croma.TypeGen.ListOf.AntikytheraCore.AsyncJob.Queue.IdJobPair.t(), brokers_to_notify: Croma.TypeGen.ListOf.Croma.Pid.t(), brokers_waiting: Croma.TypeGen.ListOf.Croma.Pid.t(), index_runnable: AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t(), index_running: AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t(), index_waiting: AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t(), jobs: AntikytheraCore.AsyncJob.Queue.JobsMap.t()}
Link to this section Functions
abandoned_jobs(t()) :: Croma.TypeGen.ListOf.AntikytheraCore.AsyncJob.Queue.IdJobPair.t()
Type-aware getter for abandoned_jobs.
Type-aware setter for abandoned_jobs.
add_consensus_group(atom()) :: :ok | {:error, :already_added | :no_leader}
add_job(atom(), Antikythera.AsyncJob.Id.t(), AntikytheraCore.AsyncJob.t(), pos_integer(), pos_integer()) :: :ok | {:error, :full | :existing_id | {:rate_limit_reached, pos_integer()}}
brokers_to_notify(t()) :: Croma.TypeGen.ListOf.Croma.Pid.t()
Type-aware getter for brokers_to_notify.
brokers_to_notify(t(), Croma.TypeGen.ListOf.Croma.Pid.t()) :: t()
Type-aware setter for brokers_to_notify.
brokers_waiting(t()) :: Croma.TypeGen.ListOf.Croma.Pid.t()
Type-aware getter for brokers_waiting.
brokers_waiting(t(), Croma.TypeGen.ListOf.Croma.Pid.t()) :: t()
Type-aware setter for brokers_waiting.
cancel(atom(), Antikythera.AsyncJob.Id.t()) :: :ok | {:error, :not_found | {:rate_limit_reached, pos_integer()}}
fetch_job(atom()) :: nil | {AntikytheraCore.AsyncJob.Queue.JobKey.t(), AntikytheraCore.AsyncJob.t()}
index_runnable(t()) :: AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t()
Type-aware getter for index_runnable.
index_runnable(t(), AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t()) :: t()
Type-aware setter for index_runnable.
index_running(t()) :: AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t()
Type-aware getter for index_running.
index_running(t(), AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t()) :: t()
Type-aware setter for index_running.
index_waiting(t()) :: AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t()
Type-aware getter for index_waiting.
index_waiting(t(), AntikytheraCore.AsyncJob.Queue.SecondaryIndex.t()) :: t()
Type-aware setter for index_waiting.
jobs(t()) :: AntikytheraCore.AsyncJob.Queue.JobsMap.t()
Type-aware getter for jobs.
jobs(t(), AntikytheraCore.AsyncJob.Queue.JobsMap.t()) :: t()
Type-aware setter for jobs.
list(atom()) :: [{Antikythera.Time.t(), Antikythera.AsyncJob.Id.t(), Antikythera.AsyncJob.StateLabel.t()}]
Creates a new instance of AntikytheraCore.AsyncJob.Queue by using the given dict
.
Returns {:ok, valid_struct}
or {:error, reason}
.
The values in the dict
are validated by each field’s valid?/1
function.
If the value was invalid, it will be passed to new/1
of the field
For missing fields, followings will be tried:
default/0
of each field typenew/1
of each field type, with empty map as input
A variant of new/1
which returns t
or raise if validation fails.
In other words, new/1
followed by Croma.Result.get!/1
.
remove_broker_from_waiting_list(atom()) :: :ok
remove_locked_job(atom(), AntikytheraCore.AsyncJob.Queue.JobKey.t()) :: :ok
status(atom(), Antikythera.AsyncJob.Id.t()) :: Croma.Result.t(Antikythera.AsyncJob.Status.t())
unlock_job_for_retry(atom(), AntikytheraCore.AsyncJob.Queue.JobKey.t()) :: :ok
Updates an existing instance of AntikytheraCore.AsyncJob.Queue with the given dict
.
The values in the dict
are validated by each field’s valid?/1
function.
Returns {:ok, valid_struct}
or {:error, reason}
.
A variant of update/2
which returns t
or raise if validation fails.
In other words, update/2
followed by Croma.Result.get!/1
.
Checks if the given value belongs to t/0
or not.