Reblessing the returned object into the class of your choosing seems like 
an incredibly fragile way of doing that. I'd recommend that you could just 
chain the returned promise with one that you create/return. 

On Tuesday, October 1, 2019 at 8:21:13 AM UTC-5, Roger Crew wrote:
>
> Mojo::UserAgent::Role::PromiseClass now exists on CPAN to play with.
>
> Promises returned by get_p can now be automatically blessed into whatever 
> class you want by just specifying it once on the UserAgent
>
> $ua = Mojo::UserAgent->new(...)
>      ->with_roles('+PromiseClass')
>      ->promise_roles('+Feature');  # add promise features to UserAgent
> $ua->get_p(...)->feature(sub{...}); # and they show up on every get_p call
>
> as opposed to having to type 
>
> $ua->get_p(...)->with_roles('+Feature')->feature(sub{...})
>
> everywhere.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mojolicious/1dbae250-02b5-4daa-9e04-6879f753d12e%40googlegroups.com.

Reply via email to