-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor the signal connection syntax #8
Comments
I would like to use a fluent interface, so maybe something like this: ctx.signals::<MySignal>().tagged(my_tag).inhibit(|signal| match { ... }).connect(); Both Alternatively, I can use something like this: ctx.connect_signals(MySignal::connector().tagged(...).inhibit(...)); The benefit here is that the connector object is the same, so if we want to support the fluent interface for building the actor - we can: builder
.actor() // might need to add ::<MyActor> here, but that's another story
.connet_signals(MySignal::connector().tagged(...).inhibit(...))
.make(MyActor {
widgets: builder.widgets()
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With #4, my solution to #2 of adding a
signals_inhibit
method that fills an optional closure (79abc12) is no longer going to work, because the same builder utilizer can be used to generate multiple signal types for multiple actors - so we can no longer just have a single optional field with that closure. While this can be a new variation ofconnect_signals
, we also haveconnect_signals_tagged
so we'll need 4 variants, and as we add new features this is going to either grow exponentially or add many many arguments to that method. I like neither way - we need a better solution.c.c. @piegamesde
The text was updated successfully, but these errors were encountered: