# Sans Periodically call remote-- possible?

**URL:** <https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026>\
**Category:** Rails\
**Created:** [June 21, 2006, 2:01pm UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026 "2006-06-21T14:01:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 21, 2006, 2:01pm UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026/1 "2006-06-21T14:01:00Z")

</div>

I was wondering, imagine this situation. You have browser 1 on machine 1  
and browser 2 on machine 2. I created a div so that I can update certain  
elements on the database. Is it possible to have the data rendered on  
browser 2 using ajax but without using the periodically call remote? Is  
it possible to use the submit event from browser 1 to trigger browser 2  
to update?

thanks,

Bing

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 22, 2006, 4:28am UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026/2 "2006-06-22T04:28:34Z")

</div>

anyone pls?

Guest wrote:

> I was wondering, imagine this situation. You have browser 1 on machine 1  
> and browser 2 on machine 2. I created a div so that I can update certain  
> elements on the database. Is it possible to have the data rendered on  
> browser 2 using ajax but without using the periodically call remote? Is  
> it possible to use the submit event from browser 1 to trigger browser 2  
> to update?
> 
> thanks,
> 
> Bing

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 22, 2006, 4:39am UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026/3 "2006-06-22T04:39:26Z")

</div>

On Thu Jun 22, 2006 at 04:28:34AM +0200, Bing T. wrote:

> anyone pls?

your main option is probably javascript’s settimeout(), selecting things  
in the db newer than a server-generated timestamp stored in the client  
and rjs to update any newer elements that may have arrived… if you plan  
on doing a lot of this, you might want to check out a framework like  
twisted - its written in python, and is expressly designed for these  
kind of realtime messaging situations, and also works with many other  
protocols besides http…

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 22, 2006, 5:44am UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026/4 "2006-06-22T05:44:06Z")

</div>

carmen wrote:

> On Thu Jun 22, 2006 at 04:28:34AM +0200, Bing T. wrote:
> 
> > anyone pls?
> 
> your main option is probably javascript’s settimeout(), selecting things  
> in the db newer than a server-generated timestamp stored in the client  
> and rjs to update any newer elements that may have arrived… if you plan  
> on doing a lot of this, you might want to check out a framework like  
> twisted - its written in python, and is expressly designed for these  
> kind of realtime messaging situations, and also works with many other  
> protocols besides http…

Wow, I was pretty overwhelmed after checking twisted. Well, I don’t have  
any knowledge with python for one. Have you tried using twisted to work  
with ruby? I checked out thr RAA and found several event frameworks but  
again, still overwhelmed with which project maybe possible for what I  
need- as I searched for projects with the keyword “events”

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 22, 2006, 7:00am UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026/5 "2006-06-22T07:00:42Z")

</div>

On Jun 21, 2006, at 8:44 PM, Bing T. wrote:

> > on doing a lot of this, you might want to check out a framework like  
> > but  
> > again, still overwhelmed with which project maybe possible for what I  
> > need- as I searched for projects with the keyword “events”
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Have a look at EventMachine. Its on [rubyforge.org](http://rubyforge.org). Its a very nice  
event driven framework for ruby.

-Ezra

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 22, 2006, 8:14am UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026/6 "2006-06-22T08:14:15Z")

</div>

Ezra Z. wrote:

> On Jun 21, 2006, at 8:44 PM, Bing T. wrote:
> 
> > > on doing a lot of this, you might want to check out a framework like  
> > > but  
> > > again, still overwhelmed with which project maybe possible for what I  
> > > need- as I searched for projects with the keyword “events”
> > 
> > –  
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > * * *
> > 
> > Rails mailing list  
> > removed\_email\_address@domain.invalid  
> > [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
> 
> Have a look at EventMachine. Its on [rubyforge.org](http://rubyforge.org). Its a very nice  
> event driven framework for ruby.
> 
> -Ezra

Hi Ezra,

I was just about to check EventMachine out. But can you help me out,  
when you say it’s single-threaded what does it exactly mean? it means  
that each client browser can only make one thread with the server at a  
time?

thanks,

Bing

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [June 22, 2006, 8:59am UTC](https://www.ruby-forum.com/t/sans-periodically-call-remote-possible/64026/7 "2006-06-22T08:59:26Z")

</div>

I had checked out Eventmachine and had a look at the forum. There was an  
inquiry there by a potential user with almost the exact same problem as  
mine and one of the responses indicated that, what I’m trying to do here  
is to evade the polling action of ajax which eventmachine isn’t build  
for.

On another note though, do you think it is possible to put an observer  
field on a remote 2 browser that references against the actions from my  
browser? It’s interesting but I totally don’t have any idea how it is  
done. For example I was trying to check out gtalk inside gmail on my  
browser. whenever I am typing, the person I’m talking to sees that  
“user1 is typing…”

does it mean that upon creation of the js window, an observer is created  
that is referenced again the person I am talking to?

These things are taken for granted so often but it’s so painfully  
difficult to do!

thanks,

Bing
