[erlang-questions] erlang to browsers ("sessions" question, I suppose)
Roman Galeev
jamhedd@REDACTED
Sun Oct 8 09:26:27 CEST 2017
> Is there already a setup where I get an Erlang process waiting for a next
message from a browser, replying to the browser with a message?
Well, you don't need BEAM on a browser to have it. If you use web sockets,
then Cowboy will spawn an Erlang process per each connection and manage its
state. On a client, you need to have a singleton (or whatever) and do the
same state management. Then you code a line protocol, and voila. And the
web socket connection is persistent. This approach has an advantage: you
can delegate the development of a browser UI to 'front-end' developers.
On Sun, Oct 8, 2017 at 8:57 AM, Mike French <mfrench@REDACTED> wrote:
> (1) I assume you want BEAM on Web Assembly these days, not JavaScript
> …
>
>
>
> http://webassembly.org/
>
>
>
> Mike
>
>
>
> *From:* erlang-questions-bounces@REDACTED [mailto:erlang-questions-
> bounces@REDACTED] *On Behalf Of *Alexandre Karpov
> *Sent:* Sunday, October 08, 2017 5:54 AM
> *To:* erlang-questions@REDACTED
> *Subject:* [erlang-questions] erlang to browsers ("sessions" question, I
> suppose)
>
>
>
> Hi all,
>
>
>
> I've just started on Cowboy (which I've discovered through this same
> mailing list, thanks y'all), and the introductory article resonated
> perfectly and expressed exactly the reasons for me quitting my last job to
> go on a "sabbatical" studying Erlang (which I've first found out back in
> 2010 from a talk by an Amazon's Principal Engineer in Seattle, who was
> leagues ahead of me in all things software, and was in love with the
> language and environment).
>
>
>
> Aside from the goal of studying the language and OTP, there were a couple
> of questions which really interested me; hope they're not too hand-wavy and
> general to raise up:
>
>
>
> 1) Will there be a BEAM emulator in Javascript?
>
> Joe chuckled in one of his talks how back when Erlang was being created,
> the computers it was to run on were weaker than our modern cell phones =)
> But, as I can see, the state of the art is still not quite there yet. What
> are your thoughts on it? Will this ever come? If no, why not? - and if yes,
> then what are the major problems? Because I'm sure you can see why this
> sounds like a majestic possible universe - imagine each browser a potential
> Erlang node...
>
>
>
> 2) Aside from that phantasy, having browser acting as a client of some
> Erlang system is obviously a reality long time ago. There are, well, web
> servers, and Cowboy with Websockets is an obvious point of interest. Sorry
> if I am using improper terminology here - is Cowboy server a good fit for
> creating and maintaining "sessions", which is to say, connections which
> have some sort of a pair of stateful process on the server side and a
> client side? Normally I'd think of databases when I think of such
> "persistent connections" - connection is actually stateless, but every
> request from a client is accompanied by database queries, and so we're
> faking the "session"... with WebSockets+Erlang, is there a more real
> session option? Is there already a setup where I get an Erlang process
> waiting for a next message from a browser, replying to the browser with a
> message?
>
>
>
> Cheers,
>
> Alex
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
--
With best regards,
Roman Galeev,
+420 702 817 968
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171008/bff0027c/attachment.htm>
More information about the erlang-questions
mailing list