- Code: Select all
Archived Post
I've browsed around through the group but didn't find anything
specifically relating to this so I tried a few different approaches
on my own but I ran into a few different issues I haven't been able
to resolve.
The question I have is: is there an easy way to limit the number of
published streams per session? Even if I have a session with 100
people in it I want to only allow two people at a time to publish
their streams.
At first I tried making a counter on load which counts the number of
currently published streams and if that number is less than 2 then
we'll go ahead and publish and if it's 2 or greater then we don't
allow the publishing of the stream. The problem that I ran into there
is that if I had two users open the page at the same time and the
number of current streams equals 1 then their browsers might send the
publish request at the same time before the other user registers that
there are two streams leading to 3 streams total (which I don't
want).
Does that make sense?
Thoughts or pointers appreciated.