litaio / lita

ChatOps for Ruby.
https://www.lita.io
MIT License
1.68k stars 179 forks source link

Per-robot state for handlers #136

Closed jimmycuadra closed 8 years ago

jimmycuadra commented 9 years ago

Sometimes a handler will need to store state or an object with expensive instantiation that persists across multiple instances. The only real recourse right now is to attach it to the handler class object itself. This makes testing awkward and error prone because the state must be manually reset per test rather than being able to rely on garbage collection and just making a new object. While the state may be shared across multiple handler instantiations, it is not shared across multiple robots, so there should be some way to store this "global" state in the robot and retrieve it later.

jimmycuadra commented 8 years ago

Implementation is in #149.