Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Support a Stop() method on handlers #24

Open
phemmer opened this issue Apr 27, 2015 · 0 comments
Open

Support a Stop() method on handlers #24

phemmer opened this issue Apr 27, 2015 · 0 comments

Comments

@phemmer
Copy link
Owner

phemmer commented Apr 27, 2015

Some handlers might spin up goroutines, and so we should support a way to shut the handler down when it has been removed.
Keep the Handler interface minimal (Event() only), but do a type assertion on it to see if it has Stop(), and call it.

Note that this might be a little less straightforward, as we want to support removing a handler, and then adding that same handler back (such as if we wanted to interpose a filter).
But some way we need to call Stop() once the handler is no longer used.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant