Skip to content

Commit

Permalink
update good formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
deankarn committed Jun 16, 2016
1 parent 7f72b69 commit e83f58b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
7 changes: 4 additions & 3 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ Pool v2 advantages over Pool v1:
Pool v3 advantages over Pool v2:
- Objects are not interfaces allowing for less breaking changes going forward.
- Now there are 2 Pool types, both completely interchangeable, a limited worker pool and unlimited pool.
- Now there are 2 Pool types, both completely interchangeable, a limited worker pool
and unlimited pool.
- Simpler usage of Work Units, instead of `<-work.Done` now can do `work.Wait()`
Important Information READ THIS!
Expand All @@ -39,8 +40,8 @@ important usage information
- When Batching DO NOT FORGET TO CALL batch.QueueComplete(),
if you do the Batch WILL deadlock
- It is your responsibility to call WorkUnit.IsCancelled() to check if it's cancelled after a blocking
operation like waiting for a connection from a pool.
- It is your responsibility to call WorkUnit.IsCancelled() to check if it's cancelled
after a blocking operation like waiting for a connection from a pool.
Usage and documentation
Expand Down
26 changes: 13 additions & 13 deletions pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@ type Pool interface {
// Queue queues the work to be run, and starts processing immediately
Queue(fn WorkFunc) WorkUnit

// Reset reinitializes a pool that has been closed/cancelled back to a working state.
// if the pool has not been closed/cancelled, nothing happens as the pool is still in
// a valid running state
// Reset reinitializes a pool that has been closed/cancelled back to a working
// state. if the pool has not been closed/cancelled, nothing happens as the pool
// is still in a valid running state
Reset()

// Cancel cancels any pending work still not committed to processing
// call Reset() to reinitialize the pool for use.
// Cancel cancels any pending work still not committed to processing.
// Call Reset() to reinitialize the pool for use.
Cancel()

// Close cleans up pool data and cancels any pending work still not committed to processing
// call Reset() to reinitialize the pool for use.
// Close cleans up pool data and cancels any pending work still not committed
// to processing. Call Reset() to reinitialize the pool for use.
Close()

// Batch creates a new Batch object for queueing Work Units separate from any others
// that may be running on the pool. Grouping these Work Units together allows for individual
// Cancellation of the Batch Work Units without affecting anything else running on the pool
// as well as outputting the results on a channel as they complete.
// NOTE: Batch is not reusable, once QueueComplete() has been called it's lifetime has been sealed
// to completing the Queued items.
// Batch creates a new Batch object for queueing Work Units separate from any
// others that may be running on the pool. Grouping these Work Units together
// allows for individual Cancellation of the Batch Work Units without affecting
// anything else running on the pool as well as outputting the results on a
// channel as they complete. NOTE: Batch is not reusable, once QueueComplete()
// has been called it's lifetime has been sealed to completing the Queued items.
Batch() Batch
}

Expand Down
3 changes: 2 additions & 1 deletion work_unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ type WorkUnit interface {
// Error returns the Work Unit's error
Error() error

// Cancel cancels this specific unit of work, if not already committed to processing.
// Cancel cancels this specific unit of work, if not already committed
// to processing.
Cancel()

// IsCancelled returns if the Work Unit has been cancelled.
Expand Down

0 comments on commit e83f58b

Please sign in to comment.