Next requests for the next available GitHub token. Server blocks the call until a token becomes available.
(args struct{}, token *Token)
| 28 | // Next requests for the next available GitHub token. |
| 29 | // Server blocks the call until a token becomes available. |
| 30 | func (accessor *TokenOverRPC) Next(args struct{}, token *Token) error { |
| 31 | id, val := accessor.client.Next() |
| 32 | *token = Token{ |
| 33 | ID: id, |
| 34 | Value: val, |
| 35 | } |
| 36 | return nil |
| 37 | } |
| 38 | |
| 39 | // Release inserts the token at `index` back into the token pool to be used by another client. |
| 40 | func (accessor *TokenOverRPC) Release(id uint64, reply *struct{}) error { |