> So if I understand this correctly, then Hemlock is a middlepiece
> between XMPP and Flash where the Flash client receives data (push)
> from the XMPP. All of the connection storing is handeled by XMPP so
> scalability should be there.
Right -- Hemlock is meant as a bridge to allow real-time data
transmission among users. XMPP provides massive scalability, and Flash
provides the ability to maintain an open socket connection for pushing
data. The server can push to the client, and vice versa.
> If I want to deploy data to a large number of clients (for example,
> because another form was updated somewhere else) how would Hemlock
> then know of the new data arriving?
The typical flow is:
- A user performs some action via Flash UI.
- The ActionScript client pushes that action's data to the XMPP server.
- The XMPP server pushes that data back out to everyone else in the
same XMPP room as that user.
- Data reaches another user's ActionScript client.
- The ActionScript client parses the incoming data, and the Flash UI
displays it.
Here, the overall flow is: human -> Flash/ActionScript -> XMPP ->
Flash/ActionScript -> human.
> In the football3s thing for
> example, does Hemlock or does XMPP learn first about the new event
> like a pass or a goal?
Football3s uses a more interesting setup:
- Spotters watch the football match on TV. Whenever a certain action
occurs (like a goal or pass), the spotter submits that action to a
typical SQL database via an HTML form. (This part is typical of
websites today.)
- A bot (daemon) monitors the SQL database for new events. The bot is
also connected to each Football3s XMPP game room.
- When the bot finds new events, it pushes their data out to every XMPP room.
- The data is then pushed out to every ActionScript client, where
Hemlock takes care of interpreting that data for use in the UI.
Here, the flow of data is: human -> SQL DB -> bot -> XMPP ->
Flash/ActionScript -> human.
> (by the way, I am pretty impressed by the speed
> of the updates! Where do you get that data from?)
High-speed humans, intently watching every game and extracting data
for your gaming pleasure. :)
Cheers,
Ron
Here's the important commit:
http://github.com/mintdigital/hemlock/commit/a4616cb52ea453829ef8b9b1ab318bf62905053d
-- In your `config/environment.as` file, you can set
`HemlockEnvironment.SERVER_PORTS` to an array of ports to try, e.g.,
`[80, 5222]`. Earlier ports take precedence; later ports are
fallbacks.
If you're feeling less adventurous, the `master` branch is time-tested
and considered stable. When we're satisfied with how our port 80
experiments go, we'll merge that work into the `master` branch.
> By the way, where do I apply for that game watching job? Sounds like a
> fantastic side job...
Yeah, it's gotta be the best job yet. :)
Cheers,
Ron