Name: hprose-workerman
Owner: Hprose
Description: A PHP class that enables you to use Hprose with Workerman. Includes custom protocol, bridge and interface. Enjoy Hprose at its finest with multi-process powers!
Created: 2015-04-07 16:31:08.0
Updated: 2018-04-11 05:25:39.0
Pushed: 2015-10-31 17:41:14.0
Homepage: null
Size: 168
Language: PHP
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Workerman is a framework for building multi-process servers in PHP. It allows you to build a Webserver or another kind of server - maybe for an API. Hprose is both, a protocol and RPC engine. It is modern, lightweight and amazingly fast. It's own serialization format supports objects, binary data and even more!
Hprose is a High Performance Remote Object Service Engine.
It is a modern, lightweight, cross-language, cross-platform, object-oriented, high performance, remote dynamic communication middleware. It is not only easy to use, but powerful. You just need a little time to learn, then you can use it to easily construct cross language cross platform distributed application system.
Hprose supports many programming languages, for example:
Through Hprose, You can conveniently and efficiently intercommunicate between those programming languages.
In order to use Hprose with a Workerman setup, you will need to have Composer. With it, the required dependencies are installed.
p
andalone
ire_once "Workerman/Autoloader.php";
ire_once "Hprose.php"; # If you run the native PECL extension, you won't need this.
ing composer
ire_once "vendor/autoload.php";
reate the worker
t = "127.0.0.1";
t = 9999;
ker = new \Workerman\Hprose($host, $port);
et options
ker->count = 4;
ker->reloadable = true;
dd a function
tion hello($w) { return "Hello, $w!"; }
ose = $worker->hprose();
ose->addFunction("hello");
tart the Workerman framework, run the worker(s)...
kerman\Worker::runAll();
You now have a Workerman instance with 4 workers listening on your local port 9999
. This server balances requests upon processes and lets you scale your application.
hprose-php
and hprose-pecl
do not currently have methods to interact with a TCP server. You will need to use NodeJS or another supported language to talk to this server instance.
For further information, please consult the hprose-php
and/or hprose-pecl
repositories.
This code is released by the standard MIT license.
This little module was coded by Kevin Ingwersen (Ingwie Phoenix) Hprose was originally developed by Ma Bingyao