|
work 0.1.0
A gig is a bunch of related work. The pool does the work.
|
A typed, nonmovable lifetime boundary for submitted tasks and descendants. Each accepted task runs exactly once. close() is idempotent and rejects later external pushes; contexts may still create children. join() closes and waits for all descendants, publishing their writes to the caller. Destruction joins. push() and close() may race: the gig mutex determines whether push is accepted. The handler and all borrowed captures must remain valid until join returns. More...
Public Member Functions | |
| void | push (T value) |
| Submit external work. Throws logic_error if close() won the race. | |
| void | push (std::span< T const > values) |
| Submit a copied batch under one admission lock. | |
| void | close () noexcept |
| Stop external submissions. Already accepted descendants still run. | |
| void | join () noexcept |
| Close and cooperatively await completion. Repeated joins are harmless. | |
| ~gig () noexcept | |
| Close and join before releasing handler and task storage. | |
A typed, nonmovable lifetime boundary for submitted tasks and descendants. Each accepted task runs exactly once. close() is idempotent and rejects later external pushes; contexts may still create children. join() closes and waits for all descendants, publishing their writes to the caller. Destruction joins. push() and close() may race: the gig mutex determines whether push is accepted. The handler and all borrowed captures must remain valid until join returns.
|
inlinenoexcept |