Inititating session from file or database

smol84

Client
Регистрация
06.01.2012
Сообщения
30
Благодарностей
2
Баллы
0
Hi guys,
I'm wondering if someone can help me figure out how to run a session based on an input from a web site. For example, lets say I have a site that gets prices of airfares from airline a, airline b and airline c.

The user would go to my site and enter the dates for their flights and other details. I have 3 templates created in c#, one for airline a, one for airline b and one for airline c.

So I want my web site to somehow pass this information to zenno, and for zenno to start the template session and return the results.

I was thinking that my site could write to a file (or database) and have each one of my zenno templates monitor a directory for a file?

For example.
user enters detail on my site
my site generates text file name data_session123.txt
templates airlineA, airlineB and airlineC all monitor C:\logs\ for a filename starting with data_session*
one each template is finished with the results they append the airfares back to the file data_session123.txt (or whatever file it picked up)

So is this the best way to do this?
Are there other ways?
How would I stop multiple threads from opening the same data_session file? and how do I get them to get the next file?
How would it run multiple sessions at once? Would this work with threading?
 

smol84

Client
Регистрация
06.01.2012
Сообщения
30
Благодарностей
2
Баллы
0

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
831
Баллы
113
That's not easiest task I've seen, but probably possible to manage it. You should run ZennoPoster on the same server you have a website and use file as connection between your site script and zenno.
You can add ID's or some code of request that user did to the file and loop zenno taking lines from there, then ZennoPoster executes template and create result file with id name .txt, for instance:
aasd123r1r1fwasdfw23rfSDFr3q.txt while Zenno running, there is a site that run in a loop trying to read from this file (aasd123r1r1fwasdfw23rfSDFr3q.txt ) by timeout and read from there once it exists
 

smol84

Client
Регистрация
06.01.2012
Сообщения
30
Благодарностей
2
Баллы
0
Thanks HB, exactly what I was thinking but would this work with multi-threading? or would it restrict to only execute one template at a time?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)