<div dir="ltr">Cool, thanks!<div>/Vlad</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 8, 2016 at 7:31 PM, Garry Hodgson <span dir="ltr"><<a href="mailto:garry@research.att.com" target="_blank">garry@research.att.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>I can't speak to ease of building user
interfaces, as we're building<br>
web security components. We started off using Webmachine, and<br>
were pretty happy with it. But some of our REST services were
sending<br>
very large messages, and the memory consumption of Webmachine,<br>
which uses strings, became a big problem. Cowboy uses binaries<br>
instead, and was a much more comfortable fit. We also need to<br>
implement various binary protocols, and being able to do so using<br>
Cowboy's underlying Ranch acceptor pools was a big win.<br>
<br>
Converting Webmachine apps to Cowboy apps was pretty
straightforward,<br>
and Cowboy feels like a more mature and feature rich Webmachine.
As<br>
you evaluate your options, I'd consider these as two
implementations<br>
of the Webmachine model, and go with the Cowboy implementation if<br>
you choose that route.<div><div class="h5"><br>
<br>
<br>
<br>
<br>
On 3/7/16 2:46 PM, Vlad Dumitrescu wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<div dir="ltr">Thanks, Loïc, I will then check out Cowboy in more
detail, to see how it feels.
<div><br>
</div>
<div>regards,</div>
<div>Vlad</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Mar 7, 2016 at 8:44 PM, Loïc
Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 03/07/2016 08:27 PM, Vlad Dumitrescu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi!<br>
<br>
I am an almost complete noob regarding this, so please
excuse me if I am<br>
asking questions with obvious answers.<br>
<br>
I have an application that I'd like to expose via a REST
api. From what<br>
I could find quickly, in the Erlang world it looks like
the main options<br>
are Webmachine and Cowboy.<br>
<br>
Does anyone have any advice on which one fits better my
requirements, as<br>
below?<br>
<br>
- the server must be embeddable in another application,
i.e. possible to<br>
start/stop without a release<br>
</blockquote>
<br>
</span>
No problem for that with Cowboy, either through a function
call or provided child specs.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- it must be possible to configure it to use a dynamic
port value<br>
(multiple independent servers may run on the same
machine)<br>
</blockquote>
<br>
</span>
No problem, set {port, 0} option and then call
ranch:get_port/1.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- the REST API is delegating to an Erlang API, so ease
of implementation<br>
would be nice :-)<br>
</blockquote>
<br>
</span>
Cowboy is inspired by Webmachine so I suppose they're pretty
close for this one.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- if it is possible to run multiple servers on the same
Erlang runtime,<br>
then it would be a big plus<br>
</blockquote>
<br>
</span>
No problem, just declare more than one listener and you're
good!<span><font color="#888888"><br>
<br>
-- <br>
Loïc Hoguin<br>
<a href="http://ninenines.eu" rel="noreferrer" target="_blank">http://ninenines.eu</a><br>
Author of The Erlanger Playbook,<br>
A book about software development using Erlang<br>
</font></span></blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><span class=""><pre>_______________________________________________
erlang-questions mailing list
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</span></blockquote>
<br>
</div>
</blockquote></div><br></div>