"... modules take a long time to initialize..."
Ja, ja or yes sure as you like. This is what common sense tells us.
But consider this funny little study i recently posted:
# app.psgi
use strict;
use warnings;
use Plack::Request;
use Plack::App::URLMap;
use JSON::Tiny qw(encode_json);
my $slash = sub {
my $env = shift;
my $json = encode_json {nose => 'cuke'};
my $status = 200;
my $request = Plack::Request->new($env);
my $headers = [
'Content-Type' => 'application/json',
'Content-Length' => length $json,
];
my $body = [ $json ];
[ $status, $headers, $body ];
};
my $urlmap = Plack::App::URLMap->new;
$urlmap->mount( "/" => $slash );
my $app = $urlmap->to_app;
__END__
Preloading the Plack stuff? JSON::Tiny might be cheap but who knows.
It is really difficult to find answers for these questions.
And what if i daemonize Starman? The switches for this task are confusing.
Thanks for your kind reply and best regards, Karl.
P.S.: I asked the author. Probably he will enlight us.
«The Crux of the Biscuit is the Apostrophe»
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|