Download the PHP package nfarring/redisrpc without Composer

On this page you can find all versions of the php package nfarring/redisrpc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package redisrpc

RedisRPC

by Nathan Farrington http://nathanfarrington.com

RedisRPC is the easiest to use RPC library in the world. (No small claim!) It has implementations in Ruby, PHP, and Python.

Introduction

Redis is a powerful in-memory data structure server that is useful for building fast distributed systems. Redis implements message queue functionality with its use of list data structures and the LPOP, BLPOP, and RPUSH commands. RedisRPC implements a lightweight RPC mechanism using Redis message queues to temporarily hold RPC request and response messages. These messages are encoded as JSON strings for portability.

Many other RPC mechanisms are either programming language specific (e.g. Java RMI) or require boiler-plate code for explicit typing (e.g. Thrift). RedisRPC was designed to be extremely easy to use by eliminating boiler-plate code while also being programming language neutral. High performance was not an initial goal of RedisRPC and other RPC libraries are likely to have better performance. Instead, RedisRPC has better programmer performance; it lets you get something working immediately.

Calculator Example

Each library implementation uses the same client and server example based off of a mutable calculator object. The clients and servers from different languages are interoperable.

<img src="http://github.com/nfarring/redisrpc/raw/master/docs/redisrpc_example.png" width=438 height=238>

  1. The client issues an RPC Request by using the Redis RPUSH command to push an RPC Request message into a Redis list called calc.
  2. The server retrieves the RPC Request message by using the Redis BLPOP command.
  3. The server dispatches the RPC Request to a local object, which in this case is a Calculator object.
  4. The server accepts the return value (or exception) from the Calculator object.
  5. The server issues an RPC Response by using the Redis RPUSH command to push an RPC Response message into a Redis list called calc:rpc:<RAND_STRING>, which was chosen by the client.
  6. The client retrieves the RPC Response message by using the Redis BLPOP command.

Note that the server or client can be made non-blocking by using the Redis LPOP command instead of BLPOP. I currently do not need this feature and have not added support for this, but patches are welcome.

That's all there is to it!

Ruby Usage

client.rb

server.rb

PHP Usage

Note that the PHP library does not currently support named function arguments.

client.php

server.php

Python Usage

client.py

The Python client also takes the additional keyword parameters timeout and transport. If transport='pickle' then it is possible to send Python objects as function arguments, but only if the server is also implemented in Python, and only if the server has access to the same libraries in order to unpickle the objects.

server.py

Installation

Ruby Installation

The redis-rb library is required. Install using RubyGems:

PHP Installation

The Predis library is required.

The RedisRPC PHP library is available from Packagist at: http://packagist.org/packages/nfarring/redisrpc. You can use Composer to install into your PHP project.

Python Installation

The redis-py library is required.

The RedisRPC Python library is available from PyPI at: http://pypi.python.org/pypi/redisrpc. You can install with pip.

Internal Message Formats

All RPC messages are JSON objects. User code will never see these objects because they are handled by the RedisRPC library.

RPC Request

An RPC Request contains two members: a function_call object and a response_queue string.

A function_call object has one required member: a name string for the function name. It also has two optional members: (a) an args list for positional function arguments, and (b) a kwargs object for named function arguments.

The response_queue string is the name of the Redis list where the corresponding RPC Response message should be pushed by the server. This queue is chosen programmatically by the client to be collision free in the Redis namespace. Also, this queue is used only for a single RPC Response message and is not reused for future RPC Response messages.

RPC Response (Successful)

If an RPC is successful, then the RPC Response object will contain a single member, a return_value of some JSON type.

RPC Response (Exception)

If an RPC encounters an exceptional condition, then the RPC Response object will contain a single member, an exception string. Note that the value of the exception string might not have any meaning to the client since the client and server might be written in different languages or the client might have no knowledge of the server's wrapped object. Therefore the best course of action is probably to display the exception value to the user.

Source Code

Source code is available at http://github.com/nfarring/redisrpc.

License

This software is available under the GPLv3 or later.

Changelog

Version 0.3.5

Version 0.3.4

Version 0.3.3

Version 0.3.2

Version 0.3.1

Version 0.3.0

Version 0.2.1

Version 0.2.0

Version 0.1.2

Version 0.1.1

Version 0.1.0


All versions of redisrpc with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
predis/predis Version >=0.7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nfarring/redisrpc contains the following files

Loading the files please wait ....