2017 © Pedro Peláez
 

library wamp-client

WAMP client in PHP

image

bazo/wamp-client

WAMP client in PHP

  • Thursday, October 16, 2014
  • by bazo
  • Repository
  • 3 Watchers
  • 10 Stars
  • 23,569 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 3 Open issues
  • 1 Versions
  • 4 % Grown

The README.md

WAMP Client

About

This library has been tested with Ratchet WAMP server. It can only send messages to the server, listening for replies is not implemented. Supported functions: - prefix - call - publish - event, (*1)

Based on https://github.com/Wisembly/elephant.io, (*2)

Usage

$client = new \WAMP\WAMPClient('http://localhost:8080');
$sessionId = $client->connect();

//establish a prefix on server
$client->prefix("calc", "http://example.com/simple/calc#");

//you can send arbitrary number of arguments
$client->call('calc', 12,14,15);

$data = [0, 1, 2];

//or array
$client->call('calc', $data);

publish an event

//$payload can be scalar or array
$exclude = [$sessionId]; //no sense in sending the payload to ourselves
$eligible = [...] //list of other clients ids that are eligible to receive this payload
$client->publish('topic', $payload, $exclude, $eligible);

$client->event('topic', $payload);
$client->disconnect();

License

This software is distributed under MIT License. See LICENSE for more info., (*3)

Author

Martin Bažík martin@bazo.sk, (*4)

Thanks

Thanks to Elephant.IO authors for the websocket communication part., (*5)

The Versions

16/10 2014

dev-master

9999999-dev

WAMP client in PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

websocket wamp ratchet