Skip to content

Commit

Permalink
update readme to include executable function
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-ng committed Nov 25, 2020
1 parent b3c99f0 commit 983f515
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ In Dynamic Priority Limiter , the goroutines with lower priority will get their
This is similar to the timeouts in the normal limiter. In the above example , goroutines will wait a maximum of 30 milliseconds. The low priority goroutines will get their
priority increased every 5 ms.

### Executable Function

```go
nl := priority.NewLimiter(3)
ctx := context.Background()
nl.Execute(ctx , priority.Low , func()error {
return sendMetrics()
})
```

Executable function will allow you to wrap your function and execute them with concurrency limit. This function is a wrapper on top of the Wait() and Finish() functions.

### Contribution

Please feel free to open up issues , create PRs for bugs/features. All contributions are welcome :)
Expand Down

0 comments on commit 983f515

Please sign in to comment.