4 ms·
while mochiweb isnt documented officially, it has an incredibly concise api, and pretty much everything is a short google away. mochiweb_http:start(Options
by daleharvey 17y ago
while mochiweb isnt documented officially, it has an incredibly concise api, and pretty much everything is a short google away.
mochiweb_http:start(Options)
and
Socket = Req:get(socket),
inet:setopts(Socket, [{active, once}]),
% Send message to comet handler here
receive
{tcp_closed, Socket} -> ok;
{error, timeout} -> send_timeout(Req);
{msg, Data} -> send_data(Req, Data)
end.
are pretty much all you need to get a working comet server going.
your 2 complaints are valid, for web development erlang certainly doesnt have nicely documented easy to use libraries, but they are coming along.
and as for the "dynamic" pattern matching, I think this is more down to experience, erlangs pattern matching is very simplistic and although when something doesnt match when you expect it to, its incredibly annoying to find out why (by incredibly annoying you just print it out before it attempts the match, then look to see why it doesnt match)
but this happens very rarely, at least in my experience.