Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

State machines compose - the state of each actor is a part of your overall application state. So you'd create a giant state machine that contains a smaller state machine for each actor. Waits and timeouts can be handled by encapsulating time into your state. Then, you can feed your state machine with "X amount of time has elapsed" messages to inform it of the passage of time, and your state machine can emit something like a "sessions 123, 456 timed out" message as a response, and you can act on that by closing the sockets associated with those sessions.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: