Giter Site home page Giter Site logo

fastcgi-nativecall-async's Introduction

FastCGI::NativeCall::Async

An asynchronous wrapper for FastCGI::NativeCall

Build Status

Synopsis

use FastCGI::NativeCall::Async;

my $fna = FastCGI::NativeCall::Async.new(path => "/tmp/fastcgi.sock", backlog => 32 );

my $count = 0;

react {
    whenever $fna -> $fcgi {
	    say $fcgi.env;
        $fcgi.Print("Content-Type: text/html\r\n\r\n{++$count}");
    }
}

Description

The rationale behind this module is to help FastCGI::NativeCall play nicely in a larger program by managing the blocking accept loop as a Supply that can for instance be used in a react block as above. It doesn't actually allow more than one FastCGI request to be processed at once for the same URI as the protocol itself precludes that. However it does allow more than one FastCGI handler to be present in the same Raku program, potentially sharing data and other resources.

Installation

You will need a working HTTP server that can handle FastCGI to be able to use this properly.

Assuming you have a working Rakudo installation you should be able to install this with zef :

 zef install FastCGI::NativeCall::Async

 # Or from a local clone 

 zef install .

Support

This module itself is fairly simple, but does depend on both other modules and the configuration of of your HTTP Server.

Please send any suggestions/patches etc to github

I'd be interested in working configurations for various HTTP servers.

Licence & Copyright

This is free software see the LICENCE file in the distribution.

© 2017 - 2021 Jonathan Stowe

fastcgi-nativecall-async's People

Contributors

jonathanstowe avatar pheix avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar

Forkers

pheix

fastcgi-nativecall-async's Issues

v0.0.4 is currupted at CPAN

Version 0.0.4 unfortunately is corrupted at CPAN: https://modules.raku.org/dist/FastCGI::NativeCall::Async:cpan:JSTOWE, so it's failed to install via zef:

===> Testing: FastCGI::NativeCall::Async:ver<0.0.4>:auth<github:jonathanstowe>:api<1.0>
[FastCGI::NativeCall::Async] ===SORRY!=== Error while compiling /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/t/001-meta.t
[FastCGI::NativeCall::Async] Failed to open file /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/lib/FastCGI/NativeCall/Async.rakumod: No such file or directory
[FastCGI::NativeCall::Async] at /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/t/001-meta.t:5
[FastCGI::NativeCall::Async] Actually thrown at:
[FastCGI::NativeCall::Async]   in any statement_control at /opt/rakudo/rakudo-star-2021.04/bin/../share/perl6/lib/Perl6/Grammar.moarvm line 1
[FastCGI::NativeCall::Async] ===SORRY!=== Error while compiling /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/t/010-use.t
[FastCGI::NativeCall::Async] Failed to open file /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/lib/FastCGI/NativeCall/Async.rakumod: No such file or directory
[FastCGI::NativeCall::Async] at /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/t/010-use.t:5
[FastCGI::NativeCall::Async] Actually thrown at:
[FastCGI::NativeCall::Async]   in any statement_control at /opt/rakudo/rakudo-star-2021.04/bin/../share/perl6/lib/Perl6/Grammar.moarvm line 1
[FastCGI::NativeCall::Async] ===SORRY!=== Error while compiling /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/t/020-basic.t
[FastCGI::NativeCall::Async] Failed to open file /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/lib/FastCGI/NativeCall/Async.rakumod: No such file or directory
[FastCGI::NativeCall::Async] at /home/kostas/.zef/store/FastCGI-NativeCall-Async-0.0.4.tar.gz/FastCGI-NativeCall-Async-0.0.4/t/020-basic.t:5
[FastCGI::NativeCall::Async] Actually thrown at:
[FastCGI::NativeCall::Async]   in any statement_control at /opt/rakudo/rakudo-star-2021.04/bin/../share/perl6/lib/Perl6/Grammar.moarvm line 1
===> Testing [FAIL]: FastCGI::NativeCall::Async:ver<0.0.4>:auth<github:jonathanstowe>:api<1.0>
Aborting due to test failure: FastCGI::NativeCall::Async:ver<0.0.4>:auth<github:jonathanstowe>:api<1.0> (use --force-test to override)

I guess lib is simply missed. Install via zef install FastCGI::NativeCall::Async https://github.com/jonathanstowe/FastCGI-NativeCall-Async.git is successful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.