Commit Graph

14 Commits

Author SHA1 Message Date
Steve Streeting
54e86de23a Make the batcher more general and not specific to Transferable 2016-05-18 16:54:54 +01:00
rubyist
900865141d fix another documentation again 2015-09-09 11:16:24 -04:00
rubyist
d8916d8b63 fix another documentation 2015-09-09 11:15:46 -04:00
rubyist
5f183ceb34 Update some documentation, reset the retrying flag in TQ 2015-09-09 10:24:50 -04:00
rubyist
e48d6feb92 The batcher Reset can be implicit 2015-09-09 10:18:49 -04:00
rubyist
826e519449 Withhold retries until the end, then retry 2015-09-04 16:01:48 -04:00
rubyist
d5d33a385c Merge branch 'master' into retries 2015-09-02 11:22:23 -04:00
Taylor Blau
e947838aae lfs/batcher: remove Lot type for []Transferable
@rubyist brings up a good point that the Lot type, being sent down to clients of
the `Batcher` type, introduces some complexity in that clients must know how
`Lot`s work. I don't think the `Lot` type gives a clear enough advantage to
warrant the added complexity for clients.

This commit drops the `Lot` type for operations directly on `[]Transferable`,
but keeps some of the refactors from earlier in PR #615.
2015-08-28 11:34:33 -04:00
Taylor Blau
79f939c99e lfs/batcher: remove ambiguity in argument to IsFull func
This commit removes an ambiguity in the signature of the IsFull function on the
Lot type. Since the IsFull method has to do with checking the length of the
underlying slice, it seemed more appropriate to call the argument something to
do with length, rather than capacity.
2015-08-28 01:06:32 -04:00
Taylor Blau
37a82cb630 lfs/batcher: refactor run goroutine, introduce type Lot
This commit introduces several refactorings to the `run` method (now called
`acceptInput`) on the Batcher type, and introduces the type `Lot`.

- A call to `acceptInput` directly does not spawn a goroutine. The recommended
  way to initialize is to spawn it as a goroutine, which is how the constructor
  method handles initialization of the Batcher type.

- The responsibility of creating new batches is pushed down into the `newBatch`
  func, which allocates a slice of `Transferable`s and sets its capacity at the
  maximum batch size by calling into the NewLot constructor func.

- The Lot type lets us make use of several convenience methods by wrapping the
  []Transferable type. Pushed out the responsibility of checking whether a given
  "batch" (now Lot) is full. Also delegates the responsibility of Lot allocation
  et. al. further down.
2015-08-28 00:58:49 -04:00
rubyist
d06ec80332 Start a retriable error 2015-08-18 16:19:11 -06:00
rubyist
4539fcfc7e Remove some stale code from batcher 2015-07-27 14:54:54 -04:00
rubyist
c20272c16c Remove batcher timeout 2015-07-15 14:32:59 -07:00
rubyist
b9c4b3abfa Introduce a batcher that batches things into groups of n 2015-07-09 13:21:07 -04:00