Welcome! Log In Create A New Profile

Advanced

Re: Re[2]: Reading from a named pipe / fifo

January 21, 2012 12:40PM
Max Wrote:
-------------------------------------------------------
> Unfortunately,
> the other app can provide the data only through a
> fifo and there's no easy way to change it due to
> licensing, so writing a fifo module for nginx
> would be the easier and cleaner solution. Igor and
> other developers, could you please give me a few
> tips to help me get started with the development
> of the fifo module? Thank you,
> Max

Personally, the way i'd do it is to write a bit of php (or python, perl, etc) called via fast cgi to read your fifo (be mindful of the blocking nature of pipes which can cause such things to hang waiting for input).

but, http://squirrelshaterobots.com/programming/php/building-a-queue-server-in-php-part-3-accepting-input-from-named-pipes/ is an example of reading a fifo from php. And it would be quite easy to do something like this (kinda off the top of my head):

location /location/of/my/fifo.html {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php-fastcgi/php-fastcgi.socket;
fastcgi_param SCRIPT_FILENAME /path/to/local/php/that/reads/pipe.php;
}

within the nginx config...
Subject Author Posted

Reading from a named pipe / fifo

Max January 20, 2012 04:38PM

Re: Reading from a named pipe / fifo

Brian Akins January 20, 2012 05:22PM

Re[2]: Reading from a named pipe / fifo

Max January 21, 2012 11:30AM

Re: Re[2]: Reading from a named pipe / fifo

takigama January 21, 2012 12:40PM

Re[4]: Reading from a named pipe / fifo

Max January 21, 2012 08:56PM

Re[4]: Reading from a named pipe / fifo (corrected)

Max January 21, 2012 08:58PM

Re[4]: Reading from a named pipe / fifo (final version)

Max January 21, 2012 09:06PM

Re: Reading from a named pipe / fifo (final version)

Brian Akins January 21, 2012 09:28PM

Re[2]: Reading from a named pipe / fifo (final version)

Max January 21, 2012 10:38PM

Re: Reading from a named pipe / fifo (final version)

Brian Akins January 22, 2012 03:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready