Object.CoordinationService (object v0.1.2)
Distributed coordination service for multi-object operations. Uses consensus algorithms and conflict resolution for large-scale coordination.
Summary
Functions
Returns a specification to start this module under a supervisor.
Coordinates a task across multiple objects using consensus algorithms.
Gets the current status of a coordination session.
Gets performance metrics for the coordination service.
Adds an object to an existing coordination session.
Removes an object from a coordination session.
Resolves conflicts between objects using configured resolution strategies.
Starts the coordination service GenServer.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Coordinates a task across multiple objects using consensus algorithms.
Parameters
object_ids: List of object IDs to coordinatecoordination_task: Task specification with type, objectives, and constraints
Returns
{:ok, session_id} with the coordination session identifier
Examples
iex> Object.CoordinationService.coordinate_objects(["obj1", "obj2"], %{type: :optimization})
{:ok, "session_abc123"}
Gets the current status of a coordination session.
Parameters
session_id: ID of the coordination session
Returns
{:ok, status} where status is :voting, :in_progress, :completed, or :failed
Gets performance metrics for the coordination service.
Returns
Map with metrics including active sessions, completed sessions, and uptime
Adds an object to an existing coordination session.
Parameters
session_id: ID of the coordination sessionobject_id: ID of the object to add
Returns
:ok on success, {:error, reason} on failure
Removes an object from a coordination session.
Parameters
session_id: ID of the coordination sessionobject_id: ID of the object to remove
Returns
:ok on success, {:ok, :session_cancelled} if last participant left
Resolves conflicts between objects using configured resolution strategies.
Parameters
conflict_context: Context describing the conflict and involved parties
Returns
Resolution result with method and outcome
Starts the coordination service GenServer.
Returns
{:ok, pid} on successful startup