Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matsumotory/mruby-disque
Disque client for mruby
https://github.com/matsumotory/mruby-disque
Last synced: about 2 months ago
JSON representation
Disque client for mruby
- Host: GitHub
- URL: https://github.com/matsumotory/mruby-disque
- Owner: matsumotory
- License: other
- Created: 2015-12-22T07:43:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-24T07:50:11.000Z (about 9 years ago)
- Last Synced: 2024-10-18T18:26:07.394Z (3 months ago)
- Language: Ruby
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mruby-disque [![Build Status](https://travis-ci.org/matsumoto-r/mruby-disque.png?branch=master)](https://travis-ci.org/matsumoto-r/mruby-disque)
[Disque](https://github.com/antirez/disque) client class## install by mrbgems
- add conf.gem line to `build_config.rb````ruby
MRuby::Build.new do |conf|# ... (snip) ...
conf.gem :mgem => 'mruby-disque'
end
```
## exampleInstall [Disque](https://github.com/antirez/disque) and start `./disque/src/disque-server`
```ruby
assert("Disque#addjob") do
d = Disque.new
job_id = d.addjob "q1", "box"
assert_not_equal(nil, job_id)
d.deljob job_id
endassert("Disque#getjob") do
d = Disque.new
d.addjob "q1", "box"
d.addjob "q1", "cat"
job1 = d.getjob "q1"
job2 = d.getjob "q1"
assert_equal("box", job1.job_name)
assert_equal("cat", job2.job_name)
d.deljob job1.job_id, job2.job_id
endassert("Disque#run_command") do
d = Disque.new
job_id = d.addjob "q1", "box"
qlen = d.run_command :qlen, "q1"
assert_equal(1, qlen)
d.deljob job_id
end
```## License
under the MIT License:
- see LICENSE file