On Jul 26, 2011 3:53 PM, "bjhaid" <abejide...@gmail.com> wrote:
> I really am not sure how to handle this since they would not be
> pointing to any url for rails, they are subscribing to the channel I
> created, but I have challenges getting the server to publish the
> required messages to them.
So, you have two servers, a Rails app and a Faye server? I would use an ActiveRecord observer to send updates to Faye using Net::HTTP. I'd write an example only I'm sending this from my phone.
On Jul 27, 2011 1:33 PM, "bjhaid" <abejide...@gmail.com> wrote:
>
> 23 EM.run {
> 24 faye.publish("/incomings", 'text' => 'Update html view!')
> 25 }
This is because EM.run starts an infinite loop and never exits until something calls EM.stop. I would just publish like this (I should do a better job of documenting this):
msg = JSON.dump('channel' => '/incomings', 'data' => {'text' => 'Update html view!'})
uri = URI.parse('http://0.0.0.0:9292/faye')
Net::HTTP.post_form(uri, :message => msg)
i know this should not be a question for this group but I have had to
battle this all day, wondering what is wrong, i am trying to write a
jquery to check if the element returned from the broadcast belongs to
a client that is identified by an element in his DOM, the codes are
pasted @ https://gist.github.com/1113498, but it just doesnt work and
i dont know why.