本文目录

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

不要轻轻地离开我,请留下点什么...

comments powered by Disqus

Published

Category

ProgLang

Tags

Contact