On Tue, Sep 15, 2020 at 7:50 PM Christopher Dodunski (Tapestry) < chrisfromtapes...@christopher.net.nz> wrote:
> Hi all, just a quick question... > Hello! > Once a Tapestry service implementation gets instantiated, and that > service's status moves to "realised", at what point does that > implementation get destroyed? > Only when Tapestry-IoC's Registry instance gets shutdown (i..e. by calling its shutdown() method), since it keeps references to all service instances. > Tapestry instantiates a service implementation the first time a service > method gets called, and I'm just wondering whether the reverse is also > true - eg. released for garbage collection if no method has been called > after a period of time. > Tapestry-IoC doesn't track whether a service hasn't been called after a period of time. > > In some cases it's needed for a service to retain state, such as keeping > a 'static final' map of connected users. This is thread safe, but would > be lost without a single service implementation instance. > > Regards, > > Chris. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Thiago