plack / Plack

PSGI toolkit and server adapters
http://plackperl.org/
Other
486 stars 214 forks source link

Argument list of the run method of the loader object #671

Closed bschmalhofer closed 2 years ago

bschmalhofer commented 2 years ago

Hi,

I'm enhancing a web application that should run in a cluster without a shared file system. My idea was to write a custom loader module that syncs with a S3 storage and restarts the web server. A bit like Plack::Loader::Restarter. Looking at the code I got confused over the argument list of the loader run method.

In Plack::Runner the call is:

$loader->run($server);

In the custom loader modules Plack::Loader::* there argument list has two entries,

sub run { my($self, $server) = @_; ...

But in in the base module Plack::Loader there is is an extra unused argument:

sub run { my($self, $server, $builder) = @_; $server->run($self->{app}); }

Is this a simple oversight or did I miss something? In the former case I could provide a pull request,

miyagawa commented 2 years ago

The API was changed in 6a7a5693bd1f7afd2a3d0f6b97353bc1a6abf6e7 but the argument list was not updated. The $builder parameter can be removed.

miyagawa commented 2 years ago

This is fixed in 2a29db30533234b3f03022fa1191c3543090de7f. Thanks!