Coder Social home page Coder Social logo

tembo's Introduction

Tembo

MIT Licensed - Copyright © 2013. Martin Bažík

About

Tembo is a rough socket.io client written in PHP. Its goal is to ease communications between your PHP application and a socket.io server. Protocol version of socket.io currently supported is 1. Only websocket transport is available at the moment.

Usage

Sending messages

use Tembo\Message;
use Tembo\SocketIOClient;

$client = new SocketIOClient('http://localhost:8000');

$client->connect();

//send message
$client->message($message);

//emit event
$args = [...];
$client->emit($event, $args);

$client->disconnect();

Listening to incoming messages

use Tembo\Message;

$callback = function($eventType, Message $message) {
	$eventName = $message->getName();
	$args = $message->getArgs();
};

$client->listen($callback);

Licence

This software is distributed under MIT License. See license.txt file for more info.

Special Thanks

Special thanks goes to Wisembly team authors of Elephant.io

tembo's People

Contributors

bazo avatar blub0hr avatar gmajoulet avatar guillaumepotier avatar mieszko4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ephp hoksi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.