{"modulePath":"tailscale.com","version":"v1.106.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package execqueue\n\nPackage execqueue implements an ordered asynchronous queue for executing functions.\n\n## Types\n\n```go\ntype ExecQueue struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (q *ExecQueue) Add(f func())\n```\n\n```go\nfunc (q *ExecQueue) RunSync(ctx context.Context, f func()) error\n```\nRunSync waits for the queue to be drained and then synchronously runs f. It returns an error if the queue is closed before f is run or ctx expires.\n\n```go\nfunc (q *ExecQueue) Shutdown()\n```\nShutdown asynchronously signals the queue to stop.\n\n```go\nfunc (q *ExecQueue) ShutdownAndWait(ctx context.Context) error\n```\nShutdownAndWait signals the queue to stop, discards any queued functions that have not started, and waits for the currently executing function, if any, to complete or ctx to expire.\n\nIt must not be called while holding a lock that a queued function may acquire, or it will not return until ctx expires.\n\n```go\nfunc (q *ExecQueue) Wait(ctx context.Context) error\n```\nWait waits for the queue to be empty or shut down.\n\n","path":"tailscale.com/util/execqueue","name":"execqueue","synopsis":"Package execqueue implements an ordered asynchronous queue for executing functions.","isRedistributable":true}
