nickelser / activejob-traffic_control

Rate limiting/job enabling for ActiveJob using distributed locks in Redis or Memcached.
298 stars 27 forks source link

Add Documentation about all options of Concurrency #3

Open psteininger opened 7 years ago

psteininger commented 7 years ago

I figured it out, I will gladly do a PR with example for docs, after I get back from vacation. Leaving today, so maybe in 10 days from now :)

nickelser commented 7 years ago

@psteininger I did try to document most things, sorry for the confusion!

I would love a PR, but barring that -- any details on what specifically was missing would be appreciated and I am happy to update!

psteininger commented 7 years ago

@nickelser one important feature, for which docs are missing is the key attribute in the options for concurrency. After reading through the code, I realized that it can be a Proc/Lamda, which totally worked for my use case (well, to a point, but the gem works as it should).

I did experience a problem with a Sidekiq backed job, which had named (not positional) parameters. The job would be called seemingly w/o parameters. I did change the signature of the perform method and got around it. Perhaps I should open another issue?

nickelser commented 7 years ago

@psteininger makes total sense -- I will add that to the docs. I also created a new issue to track the named arguments problem (https://github.com/nickelser/activejob-traffic_control/issues/5), which I'll look at shortly (could definitely be an issue how we re-enqueue the jobs).

jeremywadsack commented 6 years ago

As with @nickelser, I had to read the source (and this issue) to realize the options for the key parameter. I see the following options for Concurrency

key:           nil,
wait_timeout:  0.1, 
stale_timeout: 60 * 10

I think it would be helpful to document all of these. Either in rdoc or in the README (or both).