Skip to content

$self->ua vs. Mojo::UserAgent->new #2059

Answered by kraih
hussam-qasem asked this question in Q&A
Discussion options

You must be logged in to vote

I would probably consider that a model, and store an instance of the class in a helper during startup:

$self->helper(cool => sub { state $cool = MyApp::Network::Cool->new($app->ua) });

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@kraih
Comment options

@hussam-qasem
Comment options

@flash548
Comment options

@flash548
Comment options

@hussam-qasem
Comment options

Answer selected by hussam-qasem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants