forked from kakserpom/phpdaemon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MIGRATION-TO-0.6-GUIDE.txt
executable file
·28 lines (20 loc) · 1.15 KB
/
MIGRATION-TO-0.6-GUIDE.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
MIGRATION GUIDE (to 0.6)
Why we are here?
The version 0.6 is much faster and works better.
Common changes:
- AsyncServer/SocketSession classes are softly deprecated. It still works but you should rewrite your code.
All clients and servers have been rewritten to new paradigm of ConnectionPool (children: NetworkClient, NetworkServer).
Therefore, you cannot use old API of WebSocketServer (and etc). E.g. you should use WebSocketServer::getInstance()->addRoute(....).
New examples of code you can find in app-examples. There are no major changes, you can update your code in a couple of minutes.
Config sections like [WebSocketServer, FlashPolicy, ...] should be written as usually but in new format:
Pool:MyApp[:instanceName] {}
For example:
Pool:FlashPolicyServer {
}
Or:
Pool:FlashPolicyServer:mySecondInstance {
listen-port 12345;
file /tmp/file.xml;
}
In fact, "Pool" application shall call the object (FlashPolicyServer extends NetworkServer extends ConnectionPool), and be proxy for signals (shutdown, reload, update).
You may look at app-examples/ExampleWithRedis.php to understand how to use clients.