This should be enough, you can capture whatever type you want inside a closure.
type
Publisher = ref object
subs: seq[proc(data: int)]
Run
- How to implement observer (publish/subscribe) pattern? Kosteg
- Re: How to implement observer (publish/subscribe) pattern? dawkot
