Documentation
¶
Index ¶
- func Cancel(home string, sess Session, msgID string) error
- func Enqueue(home string, sess Session, text string) (string, error)
- func MessageStatus(home string, sess Session, msgID string) (string, error)
- func SendToAgentSession(store agentstorage.Store, runner, agentSessionID, message string, ...) (msgID string, err error)
- func StartDrainer(home string, sess Session, provider agenttty.Provider)
- func WaitForDelivery(home string, sess Session, msgID string, opts WaitOptions) error
- type Entry
- type Session
- type WaitMode
- type WaitOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MessageStatus ¶
MessageStatus reports whether a session-local message is still queued. Returns "pending" when the message is in the queue, "delivered" when the id was assigned but is no longer queued (delivered, cancelled, or timed out).
func SendToAgentSession ¶ added in v0.0.51
func SendToAgentSession(store agentstorage.Store, runner, agentSessionID, message string, waitOpts WaitOptions) (msgID string, err error)
SendToAgentSession resolves an agent session to a live TTY, enqueues a message, optionally starts the drainer, and waits per waitOpts.
func StartDrainer ¶
StartDrainer launches a background loop that elects a drainer via flock and delivers pending messages FIFO when the terminal becomes writable.
func WaitForDelivery ¶
func WaitForDelivery(home string, sess Session, msgID string, opts WaitOptions) error
WaitForDelivery polls until msgID is absent from the queue or a max-wait deadline expires.
Types ¶
type Entry ¶
type Entry struct {
ID string `json:"id"`
Text string `json:"text"`
TerminalSessionID string `json:"terminal_session_id"`
Runner string `json:"runner"`
EnqueuedAt time.Time `json:"enqueued_at"`
}
Entry is one pending send-queue message.
Click to show internal directories.
Click to hide internal directories.