Real time applications are here and users expecting that Real time data is part of UX. What are your options for building RTA with Symfony2/PHP? Slides from Symfony Camp Ukraine.
application program that functions within a time frame that the user senses as immediate or current. The latency must be less than a defined value, usually measured in seconds. Whether or not a given application qualifies as an RTA depends on the worst-case execution time (WCET), the maximum length of time a defined task or set of tasks requires on a given hardware platform. The use of RTAs is called real-time computing (RTC).
server using regular HTTP (see HTTP above). • The requested webpage executes JavaScript which requests a file from the server at regular intervals (e.g. 0.5 seconds). • The server calculates each response and sends it back, just like normal HTTP traffic.
a server using regular HTTP (see HTTP above). • The requested webpage executes JavaScript which requests a file from the server. • The server does not immediately respond with the requested information but waits until there's new information available. • When there's new information available, the server responds with the new information. • The client receives the new information and immediately sends another request to the server, re-starting the process.
client requests a webpage from a server using regular HTTP • The requested webpage executes javascript which opens a connection to the server. • The server sends an event to the client when there's new information available. • Real-time traffic from server to client, mostly that's what you'll need • You'll want to use a server that has an event loop • Not possible to connect with a server from another domain
server using regular http (see HTTP above). • The requested webpage executes JavaScript which opens a connection with the server. • The server and the client can now send each other messages when new data (on either side) is available. • Real-time traffic from the server to the client and from the client to the server • You'll want to use a server that has an event • With WebSockets it is possible to connect with a server from another domain. • It is also possible to use a third party hosted websocket server, for example Pusher or others. This way you'll only have to implement the client side, which is very easy!
as we have updates push it to client • server or client • high updated rates • uni-directional • low latency • high efficiency • business decisions, trading, unidirectional you can only push it from server to client, single persisting connection • look as servers and event as standard
integration • Standards-based • WAMP/Autobahn • JS, Android, iOS & more Cons: • No HTTP fallback • Low-level abstractions • Different programming style • You need to scale