A
A
Andrey K2012-08-15 03:23:19
Java
Andrey K, 2012-08-15 03:23:19

What technologies to choose for writing a chat?

Hello!

I have a web application written in Rails. In the near future, its development is planned - the development of a mobile application in addition to the API, which will also be in Ruby.
One of the new features of the service is a chat in which users can communicate both from the web interface and from the mobile application.

What would you use to write such a chat and why? I look with interest at Clojure, Erlang, Node.js

Answer the question

In order to leave comments, you need to log in

10 answer(s)
W
witbier, 2012-08-15
@witbier

web sockets. They are made for chats ^)

A
Alexey Sundukov, 2012-08-15
@alekciy

Erlang to the rescue. It is because of ejabberd. A good well-established solution for which JavaScript chat is also written. That does not preclude the use of desktop clients. IMHO, it turns out quite flexible + enough regardless of the main application.
PS Yandex chose erlang in due time;)

N
nekoholic, 2012-08-21
@nekoholic

Everything is very simple. Take a websphere application server, set up apache active mq there and deploy an enterprise project.

M
Maxim Sokhatsky, 2013-11-13
@5HT

An example of chat on WebSockets under Erlang:

event(chat) -> wf:send(chat, wf:q(message)),

body() ->
    wf:async(fun() -> loop() end,chat),
  [ #panel{id=history}, #textbox{id=message}, #button{postback=chat}].

loop() ->
    receive
         Message ->
             wf:insert_bottom(history, #span{text=Message}),
             wf:flush()
    end,
    loop().

The full example can be viewed here:
https://github.com/5HT/n2o/tree/master/samples

R
Renat Ibragimov, 2012-08-15
@MpaK999

Why not do it on Rails or Sinatra if RoR seems heavy.

T
trueClearThinker, 2012-08-15
@trueClearThinker

For node.js, there is such a wonderful thing as Socket.io (there is an implementation in Erlang) - a client-server library.

R
romeo_ordos, 2012-08-15
@romeo_ordos

I would choose Node.JS. Very easy to develop. As a demo, they originally made a chat. You can see here . Source code is attached.

F
FanKiLL, 2012-08-15
@FanKiLL

netty.io

Y
Yuri Yarosh, 2015-10-16
@voidnugget

If you're a hardened rubyist, you should implement a server based on
faye/faye-websocket-ruby or imanel/websocket-ruby with workers on sidekiq . As an environment, I personally prefer JRuby. I also saw people running ruby ​​sock.js . I can't even imagine why its popularity is lower than the same socket.io, and its support is many times better.
You also need to write fallback on Server-sent events and long polling.
Although you can generally not bother with websockets - it may be enough, and for chats with a large number of people, its performance will be higher than that of Websockets.
And so, in a neighboring universe, I usually use Vert.x and local sock.js with a fallback to sse.

E
eliastro, 2019-06-07
@eliastro

If you need a fast yet productive solution, check out anycable. This is a reworked rail action cable in golang, which is easily integrated into rails, replacing the action cable. As a result, you use all the goodies of the ruby ​​world and at the same time have the performance of golang under the hood.
https://anycable.io/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question