Documentation ¶
Index ¶
- type Agent
- func (a *Agent) AllocateResource(name string) error
- func (a *Agent) DeallocateResource(name string) error
- func (a *Agent) RegisterResource(name string, res resource.Resource) error
- func (a *Agent) SoftStop()
- func (a *Agent) Start()
- func (a *Agent) Stop()
- func (a *Agent) SubmitTask(t *task.Task)
- func (a *Agent) UnregisterResource(name string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent is a high-level interface for managing concurrent tasks and shared resources.
func (*Agent) AllocateResource ¶
AllocateResource reserves the specified resource for use by a task.
func (*Agent) DeallocateResource ¶
DeallocateResource releases the specified resource previously reserved by a task.
func (*Agent) RegisterResource ¶
RegisterResource registers a shared resource with the agent's resource manager.
func (*Agent) SoftStop ¶
func (a *Agent) SoftStop()
SoftStop gracefully shuts down the agent and its scheduler and executor after all tasks have completed.
func (*Agent) Start ¶
func (a *Agent) Start()
Start initializes the agent and starts its scheduler and executor.
func (*Agent) Stop ¶
func (a *Agent) Stop()
Stop gracefully shuts down the agent and its scheduler and executor.
func (*Agent) SubmitTask ¶
SubmitTask submits a task to the agent's scheduler for execution.
func (*Agent) UnregisterResource ¶
UnregisterResource removes a shared resource from the agent's resource manager.