[erlang-questions] [ANN] Bullet 0.2.0

Motiejus Jakštys desired.mta@REDACTED
Mon Jun 11 19:11:35 CEST 2012


On Mon, Jun 11, 2012 at 5:18 PM, Loïc Hoguin <essen@REDACTED> wrote:
> Hello!
>
> I'm glad to finally announce the first beta version of the Bullet project.
>
> Bullet is a Cowboy handler and associated Javascript library for
> maintaining a persistent connection between a client and a server.
>
>  https://github.com/extend/bullet
>
> In short: it does websocket when they're available, it simulates them with
> long-polling otherwise, both transports have the same exact API client and
> server-side, and it reconnects automatically on disconnection.
>
> It's already used in production by myself at least. The documentation is
> probably a bit lacking so feel free to send some feedback.

Hi,
looks interesting indeed.

It could be very useful if it had -callback specs, so we could
implement a "bullet handler". Something like this:

-module(bullet_handler).
-callback init(eh(), eh(), list(), true | false | once) -> {ok,
something(), term()}.=
(I was too lazy to go to cowboy internals to look better at it).
-callback stream(...) -> ...

In that case:
* we will know what callback modules are supposed to return
* dialyzer will verify we are returning sane things

Since -callback is supported only from R15B. I will ask a follow-up
question for erlangers to find out erlang version using macros. Then
-callback could be "constanted out".

The client library looks awesome, thanks for that. :)
-- 
Motiejus Jakštys



More information about the erlang-questions mailing list