NAME

App::teai::Round - consilium rounds: briefs out, replies back

DESCRIPTION

One round's record in teai_rounds under P.T ({thread, project, lead, created, brief: {bytes, sha1}, members: {NAME: {session, seqs}}}), written by compare-and-set (3 tries). Used by "round start" in App::teai, "round collect" in App::teai and App::teai::Dash::Rounds. Every sub calls back on the loop and never runs one. Errors are App::teai::Err objects: code 1 missing round, 2 refusal, 3 hub or malformed record, 4 busy inbox.

key($project, $thread)

P.T.

get($bus, $project, $thread, $cb)

{record, revision}, or undef without such a round.

list($bus, $project, $cb)

The records of $project (every project when undef), sorted by created, then thread.

status($bus, $project, $thread, $cb)

{record, members, replies}: per member {name, session, briefs, state, reply}, newest reply of its session to one of its brief seqs. state is replied, running (an exec presence entry), gone (no inbox), taken (ack floor past the newest brief), else sent. Code 1 no round T in project P without one. Returns a handle; see collect.

collect($bus, $project, $thread, %o, $cb)

{record, replies, missing}: the newest reply per member name and the names without one. Options: until (a Bus::now deadline to follow new mail); ack (the lead's session: counted replies, superseded ones included, are acked in its inbox, the rest handed back; a lead inbox read elsewhere fails with code 4). Returns a handle whose cancel stops it; the callback is then not called.

start($bus, %a, $cb)

project, thread, lead (sending session), body, members ([[NAME, SESSION], ...]), add and role. One msg per member on the thread, in name order. Without add the round must not exist; with add it must, led by lead, and the body is the round's brief re-read from the stream. Calls back with {sent, failed, warnings}: per member {name, session, seq} or {name, session, error}. A removed member fails the call (code 2); a member without an inbox warns. Code 3 round T not recorded: REASON (with result) when the record cannot be written after a brief was sent.

resend($bus, %a, $cb)

project, thread, lead, names and role: the round's brief again to the named members. Code 2 no member N in round T for an unknown name.

AUTHOR

vividsnow

LICENSE

Same terms as Perl itself.