Jump to content

llhttprequest on touch with multiple people touching at once


Phantium Longwell
 Share

You are about to reply to a thread that has been inactive for 4083 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi everyone,

I started working on a script where it does a llhttprequest on touch.

Of course if you set a requestkey (requestkey = llhttprequest();) and one person clicks it will work fine.
However if you then let another person click right after this only the last person will get a response from the llhttprequest.

How would I go around this issue properly? Does anyone have an example?
I realize I can remove the requestkey, but if I do this it will send both responses to the last person who clicked.

Thanks!
Phantium

Link to comment
Share on other sites

What? How are you seeing this as a fix? This is not going to fix anything in my eyes.
Also keep in mind that going to another state will break the changed event and what not since you will be in that state then, going back to the default would likely cause a loop to be created.

I was personally thinking about putting the requestkeys in a strided array and using that.
But I was looking for some suggestions here on the forums.

Going to another state is no way to do it in my eyes, and is completely unnecessary.

Link to comment
Share on other sites

Wow, someone is a little aggressive ;)

Depending on the use case I would work with lists (or with strided lists - I would love to work with arrays, but alas, there are non in LSL ;)) or simply block further clicks till the current one is processed. A third method I have used a few times is what i call a round robin robin load balancer where a central script dispatches messages to indendital http scripts that all handle single HTTP requests

Link to comment
Share on other sites

Thanks for confirming that. And no I was not being agressive, but if you're going to give someone a reply on the forums or just in general anywhere at all. I don't want to see a one liner with no useful information at all. :P Sorry but that's not helpful.

That's like asking someone how to make soup and someone answers "Fork!".

Link to comment
Share on other sites

depending on the model, changing state (or just setting a "please wait I'm working" flag, and resetting it when received) works, as does saving the request keys to a list (and then removing them as they are served)

in either use case you need to consider throttling though.... you don't want to save a null key (returned when the function is throttled... in the first method it'll permanently block further request (request never gets served, flag never gets unset), in the second method the list can eventually fill up with null keys and crash.

you can forcibly throttle your request to no more than 1/sec with a sleep, or get more complex with a queued list and a timer, but there is also a maintenance window at around 6:30 AM SLT where you will want to catch 503 returns and re-request the resource.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4083 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...