Twisted-notes

Twisted-notes

State Machine

Many Twisted protocol handlers need to write a state machine to record the state
they are at. Here are some pieces of advice which help to write state machines:

  • Don’t write bit state machines. Prefer to write a state machine witch deals
    with one level of abstraction at a time.
  • Don’t mix application-specific code with Protocol handling code. When the
    protocol handler has to make an application-specific call, keep it as a method
    call.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *