villein 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +26 -0
- data/lib/villein/agent.rb +1 -0
- data/lib/villein/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5504579a7f36a554a5b9b4097b1a989e6dfec869
|
4
|
+
data.tar.gz: 0cbdf8a76aaf7b70139a038137819e43f4321a51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9410e54f2bf7c519d186f3189696ffe32940aae6ad3cea9e92d73a50c93c2a981f086a41f014ac05e8e20f66b9f72b76f2511cd6be8e92f4f9360c99d17c80d4
|
7
|
+
data.tar.gz: c755c0fdbd9c297a018a3ed004d73e2e13320022bb5bdf982ccea89862eaa00257df83dfc1d5e364065ec59759bf57b1573fe423eb9fd6ff2dbffd7eb976c8c0
|
data/README.md
CHANGED
@@ -19,6 +19,8 @@ Or install it yourself as:
|
|
19
19
|
## Requirements
|
20
20
|
|
21
21
|
- Ruby 2.0.0+
|
22
|
+
- Serf
|
23
|
+
- v0.6.0 or later is required to use `query` and `info` method
|
22
24
|
|
23
25
|
## Usage
|
24
26
|
|
@@ -71,6 +73,12 @@ client.event('my-event', 'payload')
|
|
71
73
|
client.event('my-event', 'payload', coalesce: true)
|
72
74
|
```
|
73
75
|
|
76
|
+
### Querying
|
77
|
+
|
78
|
+
``` ruby
|
79
|
+
client.query('hey', '') #=> {"Acks"=>["XXX.local"], "Responses"=>{"XXX"=>"..."}}
|
80
|
+
```
|
81
|
+
|
74
82
|
### Retrieve member list
|
75
83
|
|
76
84
|
``` ruby
|
@@ -128,6 +136,24 @@ agent.on_event { |status|
|
|
128
136
|
}
|
129
137
|
```
|
130
138
|
|
139
|
+
### (Agent only) Respond to query events
|
140
|
+
|
141
|
+
``` ruby
|
142
|
+
agent = Villein::Agent.new
|
143
|
+
agent.start!
|
144
|
+
|
145
|
+
agent.respond("hey") { "hello" }
|
146
|
+
```
|
147
|
+
|
148
|
+
```
|
149
|
+
$ serf query hey
|
150
|
+
Query 'hey' dispatched
|
151
|
+
Ack from 'XXX.local'
|
152
|
+
Response from 'XXX.local': hello
|
153
|
+
Total Acks: 1
|
154
|
+
Total Responses: 1
|
155
|
+
```
|
156
|
+
|
131
157
|
## Advanced
|
132
158
|
|
133
159
|
TBD
|
data/lib/villein/agent.rb
CHANGED
data/lib/villein/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: villein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Fukumori (sora_h)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|