-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calling events together #38
Comments
Evented::Object 5.62 allows multiple callbacks to have the same name. It intelligently guesses which callback you are referring to by considering the object and event name to which the callbacks were attached. For Ferret this means that things like Something else neat is that all |
so now that |
OK I'm facing another issue. In Perl it is common to fire all events related to an object on that actual object. In Ferret, this would be pretty messy. It Ferret it's more common to store events in a separate object and then call them with This means that in the case of the IRC bot, we would be attaching events to the |
I'm thinking the new |
Note that this would result in the listenee holding a reference to the provided arguments until |
Hmmm, should adding a listener also imply it is a parent? Not sure |
Evented::Object allows events on different objects to be called simultaneously. I have wanted to bring this idea to Ferret for some time, but it faces new challenges.
One of the main concerns is that callback names must be unique throughout all events being fired. While this rarely causes an issue in Perl due to Evented::Object automatically generating unique callback names, Ferret would face frequent overlap. The "default function" (the one formally defined by a
func
ormethod
keyword and whose signature determines the signature of the event) is always calleddefault
. This means that virtually any two events will each have a callback nameddefault
. When firing the events together, only one of them will be executed.The text was updated successfully, but these errors were encountered: