Skip to content

Commit

Permalink
Minor README update
Browse files Browse the repository at this point in the history
  • Loading branch information
markdicksonjr committed Jun 17, 2019
1 parent 1c0fe35 commit 483c335
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Work (for Go)

A worker pool and batch processing library. Ships with a few utilities for common use-cases (e.g. XML processing).
A worker pool and batch processing library. Ships with a few utilities for common use-cases (e.g. XML processing,
splitting inputs, ensuring a single writer at a time for file output).

## Job Queue Usage

Expand All @@ -19,11 +20,8 @@ for someCondition {
// do some task to get something to put on the queue
data, isEndOfStream, err := BogusDataSource(...)

// ensure the queue doesn't drop the item
dispatcher.BlockWhileQueueFull()

// put the thing on the queue
dispatcher.EnqueueJob(work.Job{Name: "address processing", Context: &data})
// put the thing on the queue, wait if the queue is full
dispatcher.EnqueueJobAllowWait(work.Job{Name: "address processing", Context: &data})
}

// let all jobs finish before proceeding
Expand Down Expand Up @@ -96,7 +94,8 @@ passed for both arguments.

### MutexFunction

A function that will only ever be run at most once at any given time.
A function that will be run asynchronously, but at most once at any given time. Don't forget to call WaitUntilIdle at
the end of processing.

### XML

Expand Down

0 comments on commit 483c335

Please sign in to comment.