Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Blacksmoke16 committed Feb 16, 2019
1 parent 917963e commit 0e3b57f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Mosquito currently provides these features:
- Automatic rescheduling of failed jobs
- Progressively increasing delay of failed jobs
- Dead letter queue of jobs which have failed too many times
- Rate limited jobs

Current Limitations:
- Job failure delay, maximum retry count, and several other variables cannot be easily configured.
Expand Down Expand Up @@ -121,6 +122,24 @@ Would produce this output:

More information: [periodic jobs on the wiki](https://github.com/robacarp/mosquito/wiki/Periodic-Jobs)

## Throttling Jobs

Jobs can be throttled to limit the number of messages that get executed within a given period of time. For example, if 10 messages were enqueued for `ThrottledJob` at one time; 5 would be executed immediately, then pause for a minute, then execute the last 5.

```crystal
class ThrottledJob < Mosquito::QueuedJob
params message : String
throttle limit: 5, period: 60
def perform
puts message
end
end
```




## Connecting to Redis

Mosquito currently reads directly from the `REDIS_URL` environment variable to connect to redis. If no variable is set, it uses redis connection defaults to connect to redis on localhost.
Expand Down

0 comments on commit 0e3b57f

Please sign in to comment.