Jul 10
Ari Denison Getting info in and out of asasync
Jul 10, 2013; 01:31
Ari Denison
Getting info in and out of asasync
I'm using Lasso 9.2.5 on CentOS 6.4
I need a reliable way to get parameters from the main script to an asynchronously processed block of code.
I am trying to loop through a large list of PDFs so that I can use dmtxread to get information from a datamatrix-barcode coversheet on each PDF.
I am using this basic format:
{
shell('/usr/bin/convert -scale 25% -quality 100 -density 576 /longpath/source/13-02386osc.pdf[0] /longpath/png/13-02386osc.png')
shell('/usr/bin/dmtxread --page=1 -n --square-deviation=30 --threshold=15 /longpath/png/13-02386osc.png')
}->asasync();
Which does seem to spawn a new thread and doesn't delay the main script, but I can not, FOR THE LIFE OF ME, figure out how to get information into this asasync block. Globals are not an option for my environment.
I have tried:
}
// do stuff
}->asasync(-params(array('PDFFileName'='13-02386osc.pdf', 'PDFPath'='/long/path/')))
I have also tried Bil's method (from: http://www.lassosoft.com/Spawning-Asynchronous-Threads):
}
Lasso_ExecutionTimeLimit(60 * 60); // in seconds, set this to something reasonable, currently set to 1 hour
Thread_SetPriority(Thread_GetCurrentID, Thread_Priority_Low); // set priority to low, give more priority to normal web requests (can also make it high if needed)
// recreate vars - don't change the code below - this makes all the vars on the page available to the async thread
iterate(params->find('-vars')->get(1)->value, local('var')) => {^
var(#var->name=#var->value)
^}
}->asasync(-params=array( '-vars' = vars))
Both of these options give me an error similar to this in Lasso 9.5.2 on CentOS 6.4
Error Msg: Definition Not Found: capture->asasync(-params=array) Candidates were: capture->asasync()
I have even tried Bil's suggestion of using include_url(-postparms(), -nodata) as an endpoint api but that doesn't seem to spawn an independent thread at all in Lasso 9. I just sit and wait and wait as though the processing was done from the main script.
Any suggestions are VERY welcome.
Thanks!
Ari
#############################################################
Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso
Lasso@lists.lassosoft.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jul 10
Jolle Carlestam Re: Getting info in and out of asasync
Jul 10, 2013; 08:00
Jolle Carlestam
Re: Getting info in and out of asasync
Jul 10
Ke Carlton Re: Getting info in and out of asasync
Jul 10, 2013; 11:04
Ke Carlton
Re: Getting info in and out of asasync
Jul 10
Jolle Carlestam Re: Getting info in and out of asasync
Jul 10, 2013; 10:19
Jolle Carlestam
Re: Getting info in and out of asasync
Jul 10
Ari Denison Re: Getting info in and out of asasync
Jul 10, 2013; 12:34
Ari Denison
Re: Getting info in and out of asasync
Jul 10
Brad Lindsay Re: Getting info in and out of asasync
Jul 10, 2013; 17:24
Brad Lindsay
Re: Getting info in and out of asasync
Jul 10
Jolle Carlestam Re: Getting info in and out of asasync
Jul 10, 2013; 21:29
Jolle Carlestam
Re: Getting info in and out of asasync
Jul 10
Jolle Carlestam Re: Getting info in and out of asasync
Jul 10, 2013; 22:01
Jolle Carlestam
Re: Getting info in and out of asasync
Jul 10
Ari Denison Re: Getting info in and out of asasync
Jul 10, 2013; 20:36
Ari Denison
Re: Getting info in and out of asasync