NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: alan on September 04, 2013, 12:30:24 PM

Title: create additional sessionqueues
Post by: alan on September 04, 2013, 12:30:24 PM
Bruce,

I'm working on an app with a large amount of data that is loaded into a queues and then processed.  This data needs to stay available throughout a session.  I would like to create those queues the same way SessionQueue is implemented.  That is, I want to instantiate them (and some classes) at the same time (with the same scope) as the SessionQueue and I want to delete (free) them when the session is deleted.

Do you have any embeds I could use at the point all this is happening with SessionQueue?  If no embeds, is there anything else you could recommend to accomplish this?

Thanks,

Alan
Title: Re: create additional sessionqueues
Post by: bshields on September 04, 2013, 04:08:04 PM
Hi Alan,

I use the InMemory file driver with the SessionID as a key for this purpose.

Maybe that will help.

You could just define global queues (since threaded doesn't work, as sessions cross threads all the time) protected by critical sections, its cheaper! But you'll need to be careful, handy thing about the InMemory driver is if you want to do "stuff" with them, the normal clarion / nettalk templates work on them nicely.

Regards
Bill
Title: Re: create additional sessionqueues
Post by: Stu on September 04, 2013, 05:00:22 PM
Hi Alan,

+1 what Bill said. Using IMDD files with Session_ID key is a great solution.
Title: Re: create additional sessionqueues
Post by: Bruce on September 04, 2013, 09:47:41 PM
Hi Alan,

yes, In-Memory driver is perfect.
SessionID field needs to be a string(255).
And you can remove entries from this table when the session ends by adding code to
WebHandler
.NotifyDeleteSession method.

cheers
Bruce
Title: Re: create additional sessionqueues
Post by: Rob Kolanko on September 05, 2013, 11:24:06 AM
I find this method of using memory tables easier to work with.  Instead of adding a session ID field in the memory table, I create a memory table with a "name" property containing the session ID. Effectively having a table just for that session. There is no collisions with same memory tables in different sessions because the tables names are different. When session is over or are finished with the memory table, Empty and Remove statements are used to clean-up the session's table.

Rob