Conduit

 view release on metacpan or  search on metacpan

lib/Conduit.pm  view on Meta::CPAN

         );
      }
      else {
         die "TODO: other app shapes?";
      }

      $selector->add(
         data => $client,
         f    => $client->run
            ->else( sub ( $err, @ ) {
               chomp $err;
               warn "Conduit client connection failed: $err\n";
               Future->done; # don't make the server fail
            }),
      );
   }
}

=head2 run

   $run_f = $conduit->run;

Starts operation of the server, allowing it to accept new connections, serve
requests, and run the application.

Returns a L<Future> instance that in normal circumstances should never
complete; it will remain pending indefinitely. The toplevel program can either
C<await> this if it has nothing else to do, or add that to a collection such
as with L<Future::Selector>.

=cut

async method run ()
{
   $selector->add( data => "accept", f => $self->listen );
   await $selector->run;
}

=head1 TODO

Honestly, quite a lot. Almost everything in fact. ;)

=over 4

=item *

L<PAGI> support; likely in preference to any more PSGI.

=item *

Maybe support streaming PSGI responses, though it would still be preferrable
to do this with PAGI first.

=item *

Investigate split IPv4+IPv6 serving, whether it needs two socket or one will
suffice. This may be OS-dependent.

=item *

HTTPS, perhaps via L<IO::Socket::SSL> or maybe something newer?

=item *

Look into what's required to support some sort of websocket thing in addition
to plain HTTP.

=back

=cut

=head1 AUTHOR

Paul Evans <leonerd@leonerd.org.uk>

=cut

0x55AA;



( run in 1.486 second using v1.01-cache-2.11-cpan-39bf76dae61 )