Welcome Guest, Not a member yet? Register   Sign In
Asynchronously loaded data
#1

[eluser]Unknown[/eluser]
Hi
I need some tip. I would like to make that kind of mechanism:
1) user logs in to the server (this I know)
2) user gets data (this I know :- )
3) as long as user is logged in, when new data show up, they will be send to him asynchronously (that is the magic I don't know)

Where should I search to find something about it? I would like to do this in CI and jQuery (client side)

Keep warm
zie1ony
#2

[eluser]CroNiX[/eluser]
You can't really do it "when new data shows up". You would have to use AJAX with a (periodical) timer so every minute (or whatever) it sends an ajax request to the server to collect any new data since the last request. If you have firebug installed, go login to facebook. You will see ajax requests getting fired off every so often to do this exact thing.
#3

[eluser]CroNiX[/eluser]
Here's a jQuery plugin that will do this. I haven't used it.
#4

[eluser]Unknown[/eluser]
Thanks.
But what about that idea:
1) client use asyc ajax to get sth.
2) server receive request and if there is something to send, it will be sent, if not, server start loop with breake when new data show up, then send them.
3) client receive data and then do first point

But I think I need then server resistant to multi-multi-threading with good sleep option. Erlang would be good Smile
#5

[eluser]mast3rpyr0[/eluser]
With that approach you would have to create a constant connection to a server(not apache, but your own custom server software). It would also probably get confusing when more than 1 person is using your app.




Theme © iAndrew 2016 - Forum software by © MyBB