Closed jbarrett closed 3 years ago
I've pinned down my thinking here a little... It goes : "Rails ate Perl's lunch and Node ate Rails' lunch - must make async seamless somehow" ... so here we are with this.
I guess if caller()
is consistent during consumption, the role can Import::Into
all it likes, but I think I'm looking in the wrong place altogether.
I still think the idea of an author shipping a role may have merit in limited circumstances, but automagically hitting the library path for a bunch of constructed module names probably does not.
(Insert Frank-Drebin-nothing-to-see-here.gif)
Forgive me if this doesn't make sense. What I'm thinking is, roles could perform imports on their consuming class.
The
Async
role consumed here would create a$loop
slot with an instance of your event loop. It would also import keywords from, e.g.,Future::AsyncAwait
.The default search namespace would be so package authors could include some
Cor::Role::Bar
along with theirBar
package...class Foo does Bar
could go find this role, and it could effect the Class' definition and namespace without an explicituse Bar
.Thanks for reading!