2017 © Pedro Peláez
 

library bushtaxi

ZeroMQ connection manager for PHP (alpha)

image

moee/bushtaxi

ZeroMQ connection manager for PHP (alpha)

  • Thursday, November 24, 2016
  • by moee
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Bushtaxi

Bushtaxi aims at making your life with ZeroMQ easier. It establishes connections and bindings based on simple configurations., (*1)

Usage

Client

A basic configuration for a req socket looks like this:, (*2)

$config = [
  "service" => [ "name" => "client" ],
  "links" => [
    "server" => [
      "type" => "req",
      "connect" => "tcp://10.0.0.100:5000"
    ]
  ]
];

With this config you now can easily send a message to the socket specified in the config., (*3)

$bushtaxi = new Bushtaxi\Client($config);
$bushtaxi->server->send('Hello World');

Server

Binding sockets and running servers is as easy. First create a config., (*4)

$config = [
  "service" => [ "name" => "server" ],
  "links" => [
    "client" => [
      "type" => "rep",
      "bind" => "tcp://10.0.0.100:5000
    ]
  ]
];

In addition to the config you also need to specify a server runtime class. This runtime class determines what happens in every loop., (*5)

$runtime = new class extends Bushtaxi\AbstractServerRuntime {
    function handle($links) {
        $message = $links['client']->recv();
        $links['client']->send("World");
    }
};

And we are good to go:, (*6)

$bushtaxi = new Bushtaxi\Server($config, $runtime);
$bushtaxi->run();

You can find this example in the examples directory., (*7)

Run tests

cd bushtaxi
for f in $(find tests/*.yml); do docker-compose -f $f up; done

The Versions

24/11 2016

dev-master

9999999-dev

ZeroMQ connection manager for PHP (alpha)

  Sources   Download

MIT

The Requires

  • php >=7.0
  • ext-zmq *

 

The Development Requires

by Michael Osl

24/11 2016

0.0.1-alpha

0.0.1.0-alpha

ZeroMQ connection manager for PHP (alpha)

  Sources   Download

MIT

The Requires

  • php >=7.0
  • ext-zmq *

 

The Development Requires

by Michael Osl