Riak module for prosody; currently only hits the protobuf interface, and the API is very low level.
The library is non-blocking, and performs connection pooling under the hood for you.
- prosody with a working
net.server.addclient
(commited to trunk on December 23 2013) - lua-pb
Use module:depends
to load this library
servers
is an array of dictionaries with fields:host
(required string)port
(required number)sslctx
(optional table)max_connections
(optional number)
message_type
is the riak command you want to issue; a list can be found in the riak documentationdata
can benil
for commands that have no parameters; otherwise it is a table that matches the protobuf messagecallback
will be called with the response as a single argument or(nil,err)
in case of error
myriak = module:depends "riak/pb".new {
{ host = "127.0.0.1" , port = 8087 , max_connections = 10 } ;
}
myriak:rpc ( "RpbPingReq" , nil , function ( res , err )
if res == nil then
print ( "Failure!" , err )
return
end
print ( "PONG" )
end )