XXX This needs concurrency work. See issue #2546.
(ctx context.Context, b []byte)
| 95 | |
| 96 | // XXX This needs concurrency work. See issue #2546. |
| 97 | func (q *Queue) Commit(ctx context.Context, b []byte) (ID, error) { |
| 98 | head, err := q.ReadHead(ctx) |
| 99 | if err != nil { |
| 100 | return Nil, err |
| 101 | } |
| 102 | if err := q.CommitAt(ctx, head, b); err != nil { |
| 103 | return Nil, err |
| 104 | } |
| 105 | return head + 1, err |
| 106 | } |
| 107 | |
| 108 | // CommitAt commits a new serialized BSUP sequence to the journal presuming |
| 109 | // the previous state conformed to the journal position "at". The entry is |