# \[ANN\] nsq-ocaml

**URL:** <https://discuss.ocaml.org/t/ann-nsq-ocaml/467>\
**Category:** Community\
**Tags:** announce\
**Created:** [June 24, 2017, 7:15pm UTC](https://discuss.ocaml.org/t/ann-nsq-ocaml/467 "2017-06-24T19:15:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanslade](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ryanslade/32/1676_2.png) [@ryanslade](https://discuss.ocaml.org/u/ryanslade)\
**Post date:** [June 24, 2017, 7:15pm UTC](https://discuss.ocaml.org/t/ann-nsq-ocaml/467/1 "2017-06-24T19:15:16Z")

</div>

Hi

I’ve just pushed an initial version of nsq-ocaml to GitHub, which is a client library for the [NSQ](http://nsq.io/) messaging platform.

The code can be found here: [https://github.com/ryanslade/nsq-ocaml](https://github.com/ryanslade/nsq-ocaml)

This is the first significant library I’ve written in OCaml so any advice on ways to improve it would be greatly appreciated. There are still quite a few features I’d like to add but the basics are working.

Pull requests and issues welcome!

Cheers  
Ryan

---

<div class="post-metadata">

**Author:** ![orbitz](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/orbitz/32/110_2.png) [@orbitz](https://discuss.ocaml.org/u/orbitz)\
**Post date:** [June 25, 2017, 7:18pm UTC](https://discuss.ocaml.org/t/ann-nsq-ocaml/467/2 "2017-06-25T19:18:49Z")

</div>

Given the state of concurrency in Ocaml, I would break the API up into a pure one, which takes bytes and gives back a list of frames and one that takes frames and gives back bytes. That way a user can utilize whatever concurrency layer makes sens for them (perhaps no concurrency at all if they just are reading and writing a single socket. An example of this style can be seen in ocaml-tls `Engine` module. @dbuenzli also has several examples of how to do this which he makes use of in, for example, his Unicode libraries.

---

<div class="post-metadata">

**Author:** ![ryanslade](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ryanslade/32/1676_2.png) [@ryanslade](https://discuss.ocaml.org/u/ryanslade)\
**Post date:** [October 30, 2017, 7:40am UTC](https://discuss.ocaml.org/t/ann-nsq-ocaml/467/3 "2017-10-30T07:40:45Z")

</div>

Just thought I’d let everyone know that nsq-ocaml is now available on opam:

[https://opam.ocaml.org/packages/nsq/](https://opam.ocaml.org/packages/nsq/)
