totoro 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -14
- data/lib/generators/totoro/templates/worker.rb +1 -1
- data/lib/totoro/version.rb +1 -1
- data/pkg/totoro-0.1.2.gem +0 -0
- data/pkg/totoro-0.1.3.gem +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1bd582f2fffa08dd029c8d11c77552868322cc8f71bd92f18880966362d70ab
|
4
|
+
data.tar.gz: 0deb992d109d947d598de595b50e3e1f09fcee10e178ac6921ef3d1761aaec9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54f94fdc1deee3e4c2a92eea73ddf8e406989210f95989e19ced9f3f95101d3265fd310a5ebc882cefdc89abcadca079e0a6b5e0a60c5a0d0d5d051100fd76f3
|
7
|
+
data.tar.gz: ebc2e7d9c63fb256b2c7572c60fc284a63016e96327ae93c52a7f45447c761d5c714d8fef1fa0752e7b44ba2f763dc58c4d162ccf2e7980d4622a1a55eb62693
|
data/README.md
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
# Totoro
|
1
|
+
# Totoro, a RabbitMQ Util
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Totoro is a RabbitMQ util that focuses on samplify queue operation.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
7
|
+
#### Install gem
|
9
8
|
Add this line to your application's Gemfile:
|
10
9
|
|
11
10
|
```ruby
|
@@ -16,23 +15,43 @@ And then execute:
|
|
16
15
|
|
17
16
|
$ bundle
|
18
17
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
## Usage
|
18
|
+
#### Generate configuration file
|
19
|
+
```
|
20
|
+
rails g totoro:config
|
21
|
+
```
|
24
22
|
|
25
|
-
|
23
|
+
## Quick Start
|
26
24
|
|
27
|
-
|
25
|
+
#### Enqueue
|
26
|
+
```
|
27
|
+
Totoro::Queue.enqueue('queue', payload)
|
28
|
+
```
|
28
29
|
|
29
|
-
|
30
|
+
#### Dequeue
|
31
|
+
To create a dequeue daemon, first you need to create a worker
|
32
|
+
```
|
33
|
+
rails g totoro:wroker <worker_name> <queue_name>
|
34
|
+
```
|
35
|
+
after that, add business logic in the process method
|
36
|
+
```
|
37
|
+
module Worker
|
38
|
+
class WorkerClass
|
39
|
+
QUEUE = 'queue_name'
|
40
|
+
def process(payload, _metadata, _delivery_info)
|
41
|
+
# worker process
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
```
|
46
|
+
finally, run the background deamon
|
47
|
+
```
|
48
|
+
bundle exec totoro worker_class
|
49
|
+
```
|
30
50
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
51
|
|
33
52
|
## Contributing
|
34
53
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
54
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/blockchaintech-au/totoro. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
55
|
|
37
56
|
## License
|
38
57
|
|
data/lib/totoro/version.rb
CHANGED
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: totoro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ShuHui18
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -77,6 +77,8 @@ files:
|
|
77
77
|
- lib/totoro/queue.rb
|
78
78
|
- lib/totoro/version.rb
|
79
79
|
- pkg/totoro-0.1.1.gem
|
80
|
+
- pkg/totoro-0.1.2.gem
|
81
|
+
- pkg/totoro-0.1.3.gem
|
80
82
|
- spec/spec_helper.rb
|
81
83
|
- spec/totoro_spec.rb
|
82
84
|
- totoro.gemspec
|