Implementation of the Observer Pattern

question

#1

Right now I try to implement the Observer Pattern (or even the Event Pattern). But right now I’m unable too decide what would be the Julian way for it since I don’t have OO. Thus my main question is what the type tree should look like.
Though performance is not critical I try to implement it the best way in regards of “type resolution”.

Theoretical use case would be a game that fires given events in the game and a bunch of listeners that react to given types of events.
For the different types will I go for a single generic type with a symbol parameter? or abstract subclassing?
Every event needs the ability to provide additional data like an Entity that is related to the event or maybe even a time stamp. In fact it should be able to store an array of Any.

Now do you know any resources or examples or do you have some hints what way I should go?


#2

I’d assume some of your issues are adressed in https://github.com/JuliaGizmos/Reactive.jl. Maybe you can use directly or borrow implementation.