Can I use a if/do loop to emulate a FIFO line for my web service?
Hey
Since I couldnt get my web service to really support multiple users, Ive thought of simply implementing a FIFO kinda of queue like this:
(The code is made up on the spot right now. Therefore, ; may be missing, some variable declared wrong, etc. Ignore that. Just concentrate on the logic)
public class somename
{
private int users;
/*Alternative:*/
// private static int users;
public void somewebservice(String somevariable)
{
if (users>0)
{
do
{
system.out.println("please wait")
}while (users>0);
}
users=1;
system.out.println("bla");
system.out.println("bla");
system.out.println("bla");
system.out.println("bla");
/*more code here*/
//End of code:
users=0;
}
}
Would this work when multiple users call the web services at the same time to make the queue?
Thanks
Related Article: What video hosting script should i use?
is a Web Development discussion thread by samsons17 that has 1 reply, was last updated 2 years ago and has been tagged with the keywords: script-configuration.
riahc3
1,304 posts since May 2008
Reputation Points: 62
Solved Threads: 13
Skill Endorsements: 11
It works for 2 users :)
But not for 6 (3 browsers on each PC calling the web service)
riahc3
1,304 posts since May 2008
Reputation Points: 62
Solved Threads: 13
Skill Endorsements: 11