Forum: Ruby on Rails help me.... about net/http

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7e35ecb8cb04c4c15cf0ad1a0edf113d?d=identicon&s=25 anton effendi (Guest)
on 2009-04-06 05:53
(Received via mailing list)
Hai All.

I have big problem in net/http.. please help me....

* In my application have net/http for send xml...
my question => why my site only can handle one request????? so only one
user
can request to my server..???? if 2 user request... then the last user
always wait or RTO....

I want in my application have one controller to check the other
controller
run or not (the xml run or not)
ex: controller a --> controller which send xml
      controller b --> monitoring..... for check the another
controller...
---> i wrote  net/http for request controller a (on same server)... it
always will RTO.... why??? if other server.... always ok... :(


Please help me
Thank you very much












--
Wu You Duan
A93363196f047ab4a7c4dab02e90091d?d=identicon&s=25 glennswest (Guest)
on 2009-04-06 09:26
(Received via mailing list)
Rails is single threaded, it processes one request at a time.
Unless you are using nginx/mongrel cluster.

You can have any number of users, but having a server call itself is
not a good thing. You want to get out of the controller quickly, not
be waiting on something. What you might want to do is
to queue the work to a "worker" thread, and let the worker run in the
background.

In Windows you can do a "service" that will do the work for you.
Or a Daemon in Linux. Then you simply queue the work to the background
server, it can be as simple as putting a record in a table, and having
the daemon
watch for it.

Then its easy to look up and see what is going on.

Also this is good practice if you have a long running process.

You can also use rufus-scheduler to schedule background activity.

If you need some help feel free to ask.

http://mentalpagingspace.blogspot.com
This topic is locked and can not be replied to.