Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > CGI Session Synchronization

Reply
Thread Tools

CGI Session Synchronization

 
 
Patrick Li
Guest
Posts: n/a
 
      08-15-2008
I finally tracked down a bug that's been bothering me, and I'm at a
complete loss for how to fix it. If you have wisdom, please share. =)

I'm opening a CGI Session using Session.new and storing in $SESSION.

Unfortunately, my webpage has multiple windows open at a time, each of
which runs in it's own ruby VM, and accesses it's own $SESSION.

Is there a way I can synchronize my $SESSION variable?
eg. Wait for the current Session to be closed before opening it again?

eg.
In one window I'm running <Temp.rb>
which does:

$SESSION = CGI::Session.new
#bla #bla #bla
$SESSION.close

and in another window I'm running <Temp2.rb>
which does :

$SESSION = CGI::Session.new <--- I want this line to stall until
Temp.rb is done
#bla bla bla
$SESSION.close

Thank you very very much for your help.
-Patrick
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Emmanuel Oga
Guest
Posts: n/a
 
      08-16-2008
> In one window I'm running <Temp.rb>
...
> and in another window I'm running <Temp2.rb>

...

Patrick: I'm not familiar with handling CGI::Session directly at the
moment, but if you have multiple ruby processes that you need to
synchronize I'm sure you will need some form of, well... Interprocess
communication. You could even use a shared file to somehow synchronize
the work of the two processes, but maybe the best option would be to
investigate ruby standard Drb library :
http://chadfowler.com/ruby/drb.html

greets
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Patrick Li
Guest
Posts: n/a
 
      08-16-2008
Thanks for the help. It seems to be exactly what I need. I'm gonna need
to do a little research concerning distributed ruby.
-Patrick
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGI::Session How can a session be not expired and at the same time empty? djbonnici@gmail.com Perl Misc 0 06-14-2007 07:56 PM
my $session = new CGI::Session() Kevin Perl Misc 3 03-27-2007 07:32 AM
new CGI::Session creates a new session every visit. GRRR!!! TonyV Perl Misc 19 03-19-2007 06:45 AM
session and synchronization Saad Malik Java 3 07-04-2004 07:09 AM
synchronization in session bean Ittay Freiman Java 0 07-12-2003 07:55 AM



Advertisments