A very simple example using Protobuf protocol.
This example is composed by two sides a client which send serialized data using Protobuf protocol and server which receive it and decode to processing. For this example just send the input to standard output, but you can think instead of send to standard output could send to store a database.
Once you cloned this repositorie need get up the server (written in Go) which will decode messages sent by clients. This server listen on port 2110
.
Install Protobuf protocol compiler
brew install protobuf
More details about how to install Protobuf or further issue visit its oficial page
Install Go library
$ go get -u code.google.com/p/goprotobuf/...
Install protobuf gem to support compile .protoc
files for Ruby.
$ gem install protobuf
In a consola go to server
folder and run follow command:
$ go run proto_serve.go
In another console run the clients which read a CSV file and send its content to server.
$ go run proto_client.go
You must see how client send messages and severs how decode them :)
Now, you can repeat the previous step but now running ruby client.
$ ruby client.rb
Happy Hacking!