Closed idanarye closed 3 years ago
I would like to use a fluent interface, so maybe something like this:
ctx.signals::<MySignal>().tagged(my_tag).inhibit(|signal| match { ... }).connect();
Both tagged
and inhibit
are optional, of course.
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()
});
With #4, my solution to #2 of adding a
signals_inhibit
method that fills an optional closure (79abc12336ce363ab2367b707d25ef35d69b909f) 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