In principle this is workable up to the point that the output PDF needs to be handed off to the user.  In my case, it is the (authenticated) parent who is requesting their child’s report card in one of two forms each of which is created dynamically at any point along the school “term”.  The user is waiting for the output PDF from the browser.  In Laravel this is accomplished by using:

 

return response()->download($full_output_filename)->deleteFileAfterSend(true);

 

whereupon the end user sees the familiar Open, Save, … dialogue.

 

But the dispatcher pattern is very useful, and I like it very much.  In another area, I use it to monitor a directory for forms input, which are done off-line on W10 tablets using a browser and the Mongoose lightweight httpd, and then uploaded using sftp (under Cygwin).

 

Thanks, again, for the suggestions.

 

Pavneet Arora
m: +1 (647) 406-6843
e: pavneet_arora@waroc.com

 

From: luigi scarso
Sent: Monday, July 11, 2016 04:38
To: Pavneet Arora
Subject: Re: [NTG-context] Invoking ConTeXt from inside php web appliction

 

 

You can also decuple in this way : 

1) the httpd server put the request on a, input  folder shared with a dispatcher process

2) the dispatcher continuously  watch the folder,  take the request *when it' completed* (this is a critical point)

and spawn the  the right context process

3) when the context process ends, the pdf is sent again into an out  shared folder, where the dispatcher checks it (again the same critical point) and the tells to the httpd to

put the pdf in the right place.

 

Problems

1)      you need at least two server --- the httpd and the dispatcher