(ctx context.Context)
| 52 | } |
| 53 | |
| 54 | func (q *Queue) ReadHead(ctx context.Context) (ID, error) { |
| 55 | //XXX The head file can be wrong due to races but it will always be |
| 56 | // close so we should probe for the next slot(s) and update the HEAD |
| 57 | // object if we find a hit. See issue #XXX. |
| 58 | id, _, err := readID(ctx, q.engine, q.headPath) |
| 59 | return id, err |
| 60 | } |
| 61 | |
| 62 | func (q *Queue) writeHead(ctx context.Context, id ID) error { |
| 63 | return writeID(ctx, q.engine, q.headPath, id) |