Async job processing for crystal lang
Add this to your application's shard.yml
:
dependencies:
sadiq:
github: mathieulaporte/sadiq
require "sadiq"
class Archive < Sadiq::AsyncWorker
register
def perform(args)
# your code...
end
end
Sadiq is resque "compatible", so you can use ruby resque to enqueu jobs, or monitor with resque web.
###Example : In your ruby code :
require 'resque'
class Archive
@queue = 'crystal'
end
You can enqueu jobs like In your crystal code :
require "sadiq"
class Archive < Sadiq::AsyncWorker
register
def perform(args)
# your code...
end
end
./your-project-name -c [concurrency] -n [namespace] -q [queue]
- Fork it ( https://github.com/[your-github-name]/sadiq/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- [mathieulaporte] Mathieu Laporte - creator, maintainer