ruby_rabbitmq_janus 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +14 -0
- data/config/default.yml +5 -3
- data/config/requests/channel/README.md +29 -0
- data/config/requests/channel/answer.json +13 -0
- data/config/requests/channel/create.json +9 -0
- data/config/requests/channel/describe.json +10 -0
- data/config/requests/channel/destroy.json +10 -0
- data/config/requests/channel/exists.json +10 -0
- data/config/requests/channel/join.json +11 -0
- data/config/requests/channel/leave.json +11 -0
- data/config/requests/channel/list.json +9 -0
- data/config/requests/channel/offer.json +14 -0
- data/config/requests/channel/select.json +11 -0
- data/config/requests/channel/trickle.json +10 -0
- data/config/requests/peer/trickle.json +7 -0
- data/config/requests/videocast/join.json +12 -0
- data/config/requests/videocast/leave.json +11 -0
- data/config/ruby-rabbitmq-janus.yml +27 -0
- data/lib/generators/ruby_rabbitmq_janus/initializer_generator.rb +15 -24
- data/lib/generators/ruby_rabbitmq_janus/install_generator.rb +49 -0
- data/lib/rrj/info.rb +1 -1
- data/lib/rrj/init.rb +0 -2
- data/lib/rrj/rabbit/publish/listener.rb +38 -12
- data/lib/rrj/tools/config.rb +10 -6
- data/lib/rrj/tools/log.rb +5 -5
- data/spec/request/admin/request_handle_info_spec.rb +13 -0
- data/spec/request/admin/request_sessions_spec.rb +12 -0
- data/spec/request/base/request_attach_spec.rb +25 -0
- data/spec/request/base/request_create_spec.rb +17 -0
- data/spec/request/base/request_destroy_spec.rb +17 -0
- data/spec/request/base/request_detach_spec.rb +23 -0
- data/spec/request/base/request_info_spec.rb +17 -0
- data/spec/request/base/request_keepalive_spec.rb +17 -0
- data/spec/request/peer/request_trickle_spec.rb +42 -0
- data/spec/rrj/rrj_config_spec.rb +10 -0
- data/spec/rrj/rrj_log_spec.rb +21 -0
- data/spec/rrj/rrj_rabbitmq_spec.rb +18 -0
- data/spec/rrj/rrj_spec.rb +25 -0
- data/spec/spec_helper.rb +53 -0
- data/spec/support/aruba.rb +3 -0
- data/spec/support/examples.rb +83 -0
- data/spec/support/examples_peer.rb +18 -0
- data/spec/support/schemas/config/config.json +101 -0
- data/spec/support/schemas/config/rabbit.json +13 -0
- data/spec/support/schemas/request/admin/handle_info.json +17 -0
- data/spec/support/schemas/request/admin/sessions.json +13 -0
- data/spec/support/schemas/request/base/attach.json +19 -0
- data/spec/support/schemas/request/base/create.json +17 -0
- data/spec/support/schemas/request/base/destroy.json +13 -0
- data/spec/support/schemas/request/base/detach.json +13 -0
- data/spec/support/schemas/request/base/info.json +25 -0
- data/spec/support/schemas/request/base/keepalive.json +13 -0
- data/spec/support/schemas/request/channel/create.json +39 -0
- data/spec/support/schemas/request/channel/destroy.json +39 -0
- data/spec/support/schemas/request/channel/exist.json +41 -0
- data/spec/support/schemas/request/channel/list.json +37 -0
- data/spec/support/schemas/request/peer/trickle.json +21 -0
- metadata +57 -32
- data/.gitignore +0 -77
- data/.overcommit.yml +0 -12
- data/.reek +0 -7
- data/.rspec +0 -2
- data/.rubocop.yml +0 -12
- data/.travis.yml +0 -5
- data/.yardopts +0 -5
- data/CHANGELOG.md +0 -27
- data/CODE_OF_CONDUCT.md +0 -49
- data/README.md +0 -177
- data/rrj.gemspec +0 -41
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"type": "object",
|
3
|
+
"properties": {
|
4
|
+
"janus": { "type": "string", "pattern": "trickle" },
|
5
|
+
"transaction": { "type": "string" },
|
6
|
+
"candidate": {
|
7
|
+
"type": "hash",
|
8
|
+
"properties": {
|
9
|
+
"completed": { "type": "boolean" }
|
10
|
+
},
|
11
|
+
"required": [
|
12
|
+
"completed"
|
13
|
+
]
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"required": [
|
17
|
+
"janus",
|
18
|
+
"transaction",
|
19
|
+
"candidate"
|
20
|
+
]
|
21
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_rabbitmq_janus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VAILLANT Jeremy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -217,25 +217,25 @@ dependencies:
|
|
217
217
|
- !ruby/object:Gem::Version
|
218
218
|
version: 4.2.7.1
|
219
219
|
- !ruby/object:Gem::Dependency
|
220
|
-
name:
|
220
|
+
name: travis
|
221
221
|
requirement: !ruby/object:Gem::Requirement
|
222
222
|
requirements:
|
223
223
|
- - "~>"
|
224
224
|
- !ruby/object:Gem::Version
|
225
|
-
version: '1.
|
225
|
+
version: '1.8'
|
226
226
|
- - ">="
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version: 1.
|
228
|
+
version: 1.8.4
|
229
229
|
type: :development
|
230
230
|
prerelease: false
|
231
231
|
version_requirements: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
233
|
- - "~>"
|
234
234
|
- !ruby/object:Gem::Version
|
235
|
-
version: '1.
|
235
|
+
version: '1.8'
|
236
236
|
- - ">="
|
237
237
|
- !ruby/object:Gem::Version
|
238
|
-
version: 1.
|
238
|
+
version: 1.8.4
|
239
239
|
- !ruby/object:Gem::Dependency
|
240
240
|
name: bunny
|
241
241
|
requirement: !ruby/object:Gem::Requirement
|
@@ -278,20 +278,6 @@ dependencies:
|
|
278
278
|
- - "~>"
|
279
279
|
- !ruby/object:Gem::Version
|
280
280
|
version: 0.2.2
|
281
|
-
- !ruby/object:Gem::Dependency
|
282
|
-
name: colorize
|
283
|
-
requirement: !ruby/object:Gem::Requirement
|
284
|
-
requirements:
|
285
|
-
- - "~>"
|
286
|
-
- !ruby/object:Gem::Version
|
287
|
-
version: 0.8.1
|
288
|
-
type: :runtime
|
289
|
-
prerelease: false
|
290
|
-
version_requirements: !ruby/object:Gem::Requirement
|
291
|
-
requirements:
|
292
|
-
- - "~>"
|
293
|
-
- !ruby/object:Gem::Version
|
294
|
-
version: 0.8.1
|
295
281
|
description: |
|
296
282
|
This gem is used to communicate to a server Janus through RabbitMQ software
|
297
283
|
(Message-oriented middleware). It waiting a messages to Rails API who send to
|
@@ -304,18 +290,9 @@ executables: []
|
|
304
290
|
extensions: []
|
305
291
|
extra_rdoc_files: []
|
306
292
|
files:
|
307
|
-
- ".gitignore"
|
308
|
-
- ".overcommit.yml"
|
309
|
-
- ".reek"
|
310
|
-
- ".rspec"
|
311
|
-
- ".rubocop.yml"
|
312
|
-
- ".travis.yml"
|
313
|
-
- ".yardopts"
|
314
|
-
- CHANGELOG.md
|
315
|
-
- CODE_OF_CONDUCT.md
|
316
293
|
- Gemfile
|
317
294
|
- LICENSE
|
318
|
-
-
|
295
|
+
- Rakefile
|
319
296
|
- config/default.md
|
320
297
|
- config/default.yml
|
321
298
|
- config/requests/admin/handle_info.json
|
@@ -328,10 +305,27 @@ files:
|
|
328
305
|
- config/requests/base/detach.json
|
329
306
|
- config/requests/base/info.json
|
330
307
|
- config/requests/base/keepalive.json
|
308
|
+
- config/requests/channel/README.md
|
309
|
+
- config/requests/channel/answer.json
|
310
|
+
- config/requests/channel/create.json
|
311
|
+
- config/requests/channel/describe.json
|
312
|
+
- config/requests/channel/destroy.json
|
313
|
+
- config/requests/channel/exists.json
|
314
|
+
- config/requests/channel/join.json
|
315
|
+
- config/requests/channel/leave.json
|
316
|
+
- config/requests/channel/list.json
|
317
|
+
- config/requests/channel/offer.json
|
318
|
+
- config/requests/channel/select.json
|
319
|
+
- config/requests/channel/trickle.json
|
320
|
+
- config/requests/peer/trickle.json
|
321
|
+
- config/requests/videocast/join.json
|
322
|
+
- config/requests/videocast/leave.json
|
323
|
+
- config/ruby-rabbitmq-janus.yml
|
331
324
|
- lib/generators/ruby_rabbitmq_janus/configuration_generator.rb
|
332
325
|
- lib/generators/ruby_rabbitmq_janus/create_request_generator.rb
|
333
326
|
- lib/generators/ruby_rabbitmq_janus/default_request_generator.rb
|
334
327
|
- lib/generators/ruby_rabbitmq_janus/initializer_generator.rb
|
328
|
+
- lib/generators/ruby_rabbitmq_janus/install_generator.rb
|
335
329
|
- lib/rrj/errors/config.rb
|
336
330
|
- lib/rrj/errors/error.rb
|
337
331
|
- lib/rrj/errors/janus.rb
|
@@ -374,7 +368,38 @@ files:
|
|
374
368
|
- lib/rrj/tools/requests.rb
|
375
369
|
- lib/rrj/tools/tools.rb
|
376
370
|
- lib/ruby_rabbitmq_janus.rb
|
377
|
-
-
|
371
|
+
- spec/request/admin/request_handle_info_spec.rb
|
372
|
+
- spec/request/admin/request_sessions_spec.rb
|
373
|
+
- spec/request/base/request_attach_spec.rb
|
374
|
+
- spec/request/base/request_create_spec.rb
|
375
|
+
- spec/request/base/request_destroy_spec.rb
|
376
|
+
- spec/request/base/request_detach_spec.rb
|
377
|
+
- spec/request/base/request_info_spec.rb
|
378
|
+
- spec/request/base/request_keepalive_spec.rb
|
379
|
+
- spec/request/peer/request_trickle_spec.rb
|
380
|
+
- spec/rrj/rrj_config_spec.rb
|
381
|
+
- spec/rrj/rrj_log_spec.rb
|
382
|
+
- spec/rrj/rrj_rabbitmq_spec.rb
|
383
|
+
- spec/rrj/rrj_spec.rb
|
384
|
+
- spec/spec_helper.rb
|
385
|
+
- spec/support/aruba.rb
|
386
|
+
- spec/support/examples.rb
|
387
|
+
- spec/support/examples_peer.rb
|
388
|
+
- spec/support/schemas/config/config.json
|
389
|
+
- spec/support/schemas/config/rabbit.json
|
390
|
+
- spec/support/schemas/request/admin/handle_info.json
|
391
|
+
- spec/support/schemas/request/admin/sessions.json
|
392
|
+
- spec/support/schemas/request/base/attach.json
|
393
|
+
- spec/support/schemas/request/base/create.json
|
394
|
+
- spec/support/schemas/request/base/destroy.json
|
395
|
+
- spec/support/schemas/request/base/detach.json
|
396
|
+
- spec/support/schemas/request/base/info.json
|
397
|
+
- spec/support/schemas/request/base/keepalive.json
|
398
|
+
- spec/support/schemas/request/channel/create.json
|
399
|
+
- spec/support/schemas/request/channel/destroy.json
|
400
|
+
- spec/support/schemas/request/channel/exist.json
|
401
|
+
- spec/support/schemas/request/channel/list.json
|
402
|
+
- spec/support/schemas/request/peer/trickle.json
|
378
403
|
homepage: https://github.com/dazzl-tv/ruby-rabbitmq-janus
|
379
404
|
licenses:
|
380
405
|
- MIT
|
data/.gitignore
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
# Created by https://www.gitignore.io/api/ruby
|
2
|
-
|
3
|
-
### Ruby ###
|
4
|
-
*.gem
|
5
|
-
*.rbc
|
6
|
-
/.config
|
7
|
-
/coverage/
|
8
|
-
/InstalledFiles
|
9
|
-
/pkg/
|
10
|
-
/spec/reports/
|
11
|
-
/spec/examples.txt
|
12
|
-
/test/tmp/
|
13
|
-
/test/version_tmp/
|
14
|
-
/tmp/
|
15
|
-
/log/
|
16
|
-
|
17
|
-
# Used by dotenv library to load environment variables.
|
18
|
-
# .env
|
19
|
-
|
20
|
-
## Specific to RubyMotion:
|
21
|
-
.dat*
|
22
|
-
.repl_history
|
23
|
-
build/
|
24
|
-
*.bridgesupport
|
25
|
-
build-iPhoneOS/
|
26
|
-
build-iPhoneSimulator/
|
27
|
-
|
28
|
-
## Specific to RubyMotion (use of CocoaPods):
|
29
|
-
#
|
30
|
-
# We recommend against adding the Pods directory to your .gitignore. However
|
31
|
-
# you should judge for yourself, the pros and cons are mentioned at:
|
32
|
-
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
33
|
-
#
|
34
|
-
# vendor/Pods/
|
35
|
-
|
36
|
-
## Documentation cache and generated files:
|
37
|
-
/.yardoc/
|
38
|
-
/_yardoc/
|
39
|
-
/doc/
|
40
|
-
/rdoc/
|
41
|
-
|
42
|
-
## Environment normalization:
|
43
|
-
/.bundle/
|
44
|
-
/vendor/bundle
|
45
|
-
/lib/bundler/man/
|
46
|
-
|
47
|
-
# for a library or gem, you might want to ignore these files since the code is
|
48
|
-
# intended to run in multiple environments; otherwise, check them in:
|
49
|
-
Gemfile.lock
|
50
|
-
# .ruby-version
|
51
|
-
# .ruby-gemset
|
52
|
-
|
53
|
-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
54
|
-
.rvmrc
|
55
|
-
|
56
|
-
### ruby-rabbitmq-janus ###
|
57
|
-
|
58
|
-
## Configuration customize
|
59
|
-
config/ruby-rabbitmq-janus.yml
|
60
|
-
|
61
|
-
## Request customize
|
62
|
-
config/requests/channel
|
63
|
-
config/requests/videocast
|
64
|
-
config/requests/peer
|
65
|
-
|
66
|
-
## Schema JSON response
|
67
|
-
spec/support/schemas/request/channel
|
68
|
-
spec/support/schemas/request/videocast
|
69
|
-
spec/support/schemas/request/peer
|
70
|
-
|
71
|
-
## Support RSpec
|
72
|
-
spec/support/examples_peer.rb
|
73
|
-
|
74
|
-
## Unitaire test for request customize
|
75
|
-
spec/request/channel
|
76
|
-
spec/request/videocast
|
77
|
-
spec/request/peer
|
data/.overcommit.yml
DELETED
data/.reek
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.travis.yml
DELETED
data/.yardopts
DELETED
data/CHANGELOG.md
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# Change Log
|
2
|
-
|
3
|
-
All notable changes to this project will be documented in this file.
|
4
|
-
|
5
|
-
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
|
-
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
|
-
|
8
|
-
|
9
|
-
## [1.1.8] - 2016-11-29
|
10
|
-
### Changed
|
11
|
-
- Return handle created with start_handle method
|
12
|
-
- Complete info in README.md
|
13
|
-
- Change metrics length
|
14
|
-
### Deleted
|
15
|
-
- Delete a test script `listen.rb`
|
16
|
-
|
17
|
-
## [1.1.7] - 2016-11-28
|
18
|
-
### Changed
|
19
|
-
- Use handle if is given in arguments for handle_message_simple
|
20
|
-
- Update default initializer with comments and fix rake execution
|
21
|
-
|
22
|
-
## [1.1.6] - 2016-11-24
|
23
|
-
### Added
|
24
|
-
- Add this changelog file
|
25
|
-
|
26
|
-
### Changed
|
27
|
-
- Update in config file log level field reading upcase or downcase is acceptable
|
data/CODE_OF_CONDUCT.md
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
# Contributor Code of Conduct
|
2
|
-
|
3
|
-
As contributors and maintainers of this project, and in the interest of
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
7
|
-
|
8
|
-
We are committed to making participation in this project a harassment-free
|
9
|
-
experience for everyone, regardless of level of experience, gender, gender
|
10
|
-
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
-
body size, race, ethnicity, age, religion, or nationality.
|
12
|
-
|
13
|
-
Examples of unacceptable behavior by participants include:
|
14
|
-
|
15
|
-
* The use of sexualized language or imagery
|
16
|
-
* Personal attacks
|
17
|
-
* Trolling or insulting/derogatory comments
|
18
|
-
* Public or private harassment
|
19
|
-
* Publishing other's private information, such as physical or electronic
|
20
|
-
addresses, without explicit permission
|
21
|
-
* Other unethical or unprofessional conduct
|
22
|
-
|
23
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
-
threatening, offensive, or harmful.
|
28
|
-
|
29
|
-
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
-
fairly and consistently applying these principles to every aspect of managing
|
31
|
-
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
-
Conduct may be permanently removed from the project team.
|
33
|
-
|
34
|
-
This code of conduct applies both within project spaces and in public spaces
|
35
|
-
when an individual is representing the project or its community.
|
36
|
-
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
-
reported by contacting a project maintainer at TODO: Write your email address. All
|
39
|
-
complaints will be reviewed and investigated and will result in a response that
|
40
|
-
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
incident.
|
43
|
-
|
44
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
-
version 1.3.0, available at
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
-
|
48
|
-
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/README.md
DELETED
@@ -1,177 +0,0 @@
|
|
1
|
-
# ruby-rabbitmq-janus -- RRJ
|
2
|
-
Ruby Gem for Janus WebRTC Gateway integration using RabbitMQ message queue
|
3
|
-
|
4
|
-
This gem is used to communicate to a server Janus through RabbitMQ software (
|
5
|
-
Message-oriented middleware). It waiting a messages to Rails API who send to RabbitMQ
|
6
|
-
server in a queue for janus server. janus processes a message and send to RabbitMQ server
|
7
|
-
in a queue for gem. Once the received message is decoded and returned through the Rails API.
|
8
|
-
|
9
|
-
|
10
|
-
This gem is product by [Dazzl.tv](http://dazzl.tv)
|
11
|
-
|
12
|
-
## Menu
|
13
|
-
* [How to use](#how-to-use)
|
14
|
-
* [Installation](#installation)
|
15
|
-
* [Configuration](#configuration)
|
16
|
-
* [Usage](#usage)
|
17
|
-
* [Usage Synchrounous](#usage-with-synchronous-request)
|
18
|
-
* [Usage Asynchrounous](#usage-with-asynchronous-request)
|
19
|
-
* [Aliases](#aliases)
|
20
|
-
* [Upgrade](#upgrade)
|
21
|
-
* [Development](#development)
|
22
|
-
* [RSpec](#rspec-test)
|
23
|
-
* [Documentation](#documentation)
|
24
|
-
* [Read documentation](#read-documentation)
|
25
|
-
* [Generate developer documentation](#generate-developer-documentation)
|
26
|
-
|
27
|
-
## How to use
|
28
|
-
|
29
|
-
### Installation
|
30
|
-
|
31
|
-
Use rubygem for installing gem in your application. Add in your Gemfile
|
32
|
-
```ruby
|
33
|
-
gem 'ruby_rabbitmq_janus'
|
34
|
-
```
|
35
|
-
|
36
|
-
### Configuration
|
37
|
-
|
38
|
-
If you want used a customize configuration see [ruby-rabbitmq-janus.yml](config/default.md)
|
39
|
-
|
40
|
-
Use generator for complete installation :
|
41
|
-
```ruby
|
42
|
-
rails g -h
|
43
|
-
RubyRabbitmqJanus:
|
44
|
-
ruby_rabbitmq_janus:configuration
|
45
|
-
# Generate a custom configuration file.
|
46
|
-
|
47
|
-
ruby_rabbitmq_janus:default_request
|
48
|
-
# Copy base request file sending to janus in application. It's necessary if you want add your request.
|
49
|
-
|
50
|
-
ruby_rabbitmq_janus:initializer
|
51
|
-
# Generate a initializer to this gem for rails application.
|
52
|
-
|
53
|
-
ruby_rabbitmq_janus:create_request
|
54
|
-
# Create an request to json format for RubyRabbitmqJanus transaction.
|
55
|
-
```
|
56
|
-
|
57
|
-
For create an new request is simple. Use a command generator :
|
58
|
-
```ruby
|
59
|
-
rails g ruby_rabbitmq_janus:create_request test info 'transaction:<string>,body:{plugins:false}'
|
60
|
-
create config/requests/test/info.json
|
61
|
-
```
|
62
|
-
|
63
|
-
### Usage
|
64
|
-
|
65
|
-
#### Usage with synchronous request
|
66
|
-
|
67
|
-
Exemple usage simple :
|
68
|
-
```ruby
|
69
|
-
# Initialize gem
|
70
|
-
transaction = RubyRabbitmqJanus::RRJ.new
|
71
|
-
|
72
|
-
# Send a message type 'create'
|
73
|
-
create = transaction.message_template_ask_sync('create')
|
74
|
-
=> {"janus"=>"create",
|
75
|
-
"transaction"=>"U5MZ8IYNLF",
|
76
|
-
"correlation"=>"6e77d355-6c3e-450c-89ad-a5daeb8e006a"}
|
77
|
-
create_response = transaction.message_template_response(create)
|
78
|
-
=> {"janus"=>"success", "transaction"=>"U5MZ8IYNLF", "data"=>{"id"=>7123088323743398}}
|
79
|
-
|
80
|
-
# Destroy session created
|
81
|
-
destroy = transaction.message_template_ask_sync('destroy')
|
82
|
-
=> {"janus"=>"destroy",
|
83
|
-
"session_id"=>7123088323743398,
|
84
|
-
"transaction"=>"PKS63VJD8C",
|
85
|
-
"correlation"=>"6e34d8d6-814a-4633-bcab-be3e24cc6260"}
|
86
|
-
destroy_response = transaction_template_response(destroy)
|
87
|
-
=> {"janus"=>"success", "session_id"=>7123088323743398, "transaction"=>"PKS63VJD8C"}
|
88
|
-
```
|
89
|
-
|
90
|
-
Example usage with a complex request :
|
91
|
-
```ruby
|
92
|
-
# Initialize gem
|
93
|
-
transaction = RubyRabbitmqJanus::RRJ.new
|
94
|
-
|
95
|
-
# Send a request type
|
96
|
-
transaction.transaction_plugin do |session_running|
|
97
|
-
test = transaction.ask_sync('test', session_running)
|
98
|
-
session = transaction.response_sync(session_running)
|
99
|
-
end
|
100
|
-
```
|
101
|
-
|
102
|
-
#### Usage with asynchronous request
|
103
|
-
|
104
|
-
Exemple usage simple :
|
105
|
-
|
106
|
-
```ruby
|
107
|
-
# Initialize gem
|
108
|
-
transaction = RubyRabbitmqJanus::RRJ.new
|
109
|
-
|
110
|
-
# Send a message type create
|
111
|
-
create = transaction.ask_async('create')
|
112
|
-
=> {"janus"=>"success", "session_id"=>1144864650609378, "transaction"=>"0XGUTFDLBK"}
|
113
|
-
|
114
|
-
# Send a message type destroy
|
115
|
-
transaction.ask_async('destroy', create)
|
116
|
-
=> {"janus"=>"success", "session_id"=>1144864650609378, "transaction"=>"UPODB8YEG1"}
|
117
|
-
```
|
118
|
-
|
119
|
-
#### Aliases
|
120
|
-
|
121
|
-
```ruby
|
122
|
-
# Aliases to methods synchronous
|
123
|
-
message_template_ask_sync => ask_sync
|
124
|
-
message_template_response => response_sync
|
125
|
-
|
126
|
-
# Aliases to methods asynchronous
|
127
|
-
message_template_ask_async => ask_async
|
128
|
-
```
|
129
|
-
|
130
|
-
## Development
|
131
|
-
|
132
|
-
### RSpec test
|
133
|
-
|
134
|
-
```linux
|
135
|
-
bundle exec rspec
|
136
|
-
```
|
137
|
-
|
138
|
-
TIPS: for rspec install janus and rabbitmq server configured by default for user
|
139
|
-
rabbitmq and use plugin echotest for janus server.
|
140
|
-
|
141
|
-
Use tags for rspec :
|
142
|
-
|
143
|
-
| type | name |
|
144
|
-
| --------------- | --------------- |
|
145
|
-
| request | attach |
|
146
|
-
| | create |
|
147
|
-
| | detach |
|
148
|
-
| | info |
|
149
|
-
| | test |
|
150
|
-
| level | base |
|
151
|
-
| | admin |
|
152
|
-
| config | rabbit |
|
153
|
-
| | log |
|
154
|
-
| | config |
|
155
|
-
|
156
|
-
## Upgrade
|
157
|
-
|
158
|
-
For upgrade your application read [CHANGELOG.md](CHANGELOG.md)
|
159
|
-
|
160
|
-
### Documentation
|
161
|
-
|
162
|
-
#### Read documentation
|
163
|
-
|
164
|
-
The documentation is accessible in [rubydoc](http://www.rubydoc.info/gems/ruby_rabbitmq_janus/)
|
165
|
-
|
166
|
-
#### Generate developer documentation
|
167
|
-
|
168
|
-
This doc is generated with yard.
|
169
|
-
|
170
|
-
```
|
171
|
-
# Genereate doc
|
172
|
-
yard
|
173
|
-
# Launch server
|
174
|
-
yard server
|
175
|
-
```
|
176
|
-
|
177
|
-
[See Yard Getting Started](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md)
|