https://github.com/prdn/pigato-ruby
PIGATO - an high-performance microservices framework for Ruby, Node.js and Io.js
https://github.com/prdn/pigato-ruby
Last synced: 10 months ago
JSON representation
PIGATO - an high-performance microservices framework for Ruby, Node.js and Io.js
- Host: GitHub
- URL: https://github.com/prdn/pigato-ruby
- Owner: prdn
- License: mit
- Created: 2015-03-07T14:08:16.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-11-10T19:05:51.000Z (over 9 years ago)
- Last Synced: 2025-05-15T06:44:58.258Z (about 1 year ago)
- Language: Ruby
- Homepage: http://prdn.github.io/pigato/
- Size: 50.8 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# PIGATO-RUBY - Ruby Client / Worker for PIGATO
[](https://github.com/prdn/pigato-ruby)
**PIGATO - an high-performance microservices framework based on ZeroMQ**
PIGATO aims to offer an high-performance, reliable, scalable and extensible service-oriented framework supporting multiple programming languages: Node.js/Io.js and Ruby.
* [Official PIGATO project page](http://prdn.github.io/pigato/)
* [Node.js and io.js broker/client/worker](https://github.com/prdn/pigato)
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'pigato'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install pigato
## API
### Client
#### `Pigato::Client.new(addr, conf)`
**Example**
```
require "rubygems"
require "pigato"
client = Pigato::Client.new('tcp://localhost:55555', { :autostart => 1 })
client.request('echo', 'Hello world', { 'nocache' => 1 })
```
### Worker
#### `Pigato::Worker.new(addr, serviceName)`
**Example**
```
worker = Pigato::Worker.new('tcp://localhost:55555', 'echo')
reply = nil
loop do
request = worker.recv reply
worker.reply request
end
```
## Usage
In order to run the example you need to run Node.js PIGATO example Broker from the [main project](https://github.com/prdn/pigato/tree/master/examples)
Example client/worker echo:
* `examples/echo_client.rb`
* `examples/echo_worker.rb`
## Contributing
1. Fork it ( https://github.com/[my-github-username]/pigato/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request