# Julian design for API library with Websocket client

**URL:** <https://discourse.julialang.org/t/julian-design-for-api-library-with-websocket-client/60281>\
**Category:** Web Stack\
**Tags:** question, design\
**Created:** [April 30, 2021, 12:48am UTC](https://discourse.julialang.org/t/julian-design-for-api-library-with-websocket-client/60281 "2021-04-30T00:48:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spirarel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/spirarel/32/23753_2.png) [@Spirarel](https://discourse.julialang.org/u/Spirarel)\
**Post date:** [April 30, 2021, 12:48am UTC](https://discourse.julialang.org/t/julian-design-for-api-library-with-websocket-client/60281/1 "2021-04-30T00:48:58Z")

</div>

I’m writing a Julia library to interact with an API that communicates via HTTP.Websockets. I’m struggling to find good, non-toy-repl, examples that illustrate the kind of contract a Julia dev would expect. In OO land it’s not uncommon to create an object that manages the stream with overwritten methods, but this doesn’t strike me as terribly Julian.

If you were using an library to access streaming data via websocket (Reddit, Coinbase, Slack, etc.) what kind of contract would you expect?

I realize this question is a little more art than science. If anyone has ideas or can point me to good examples in Julia I’d be very appreciative!

---

<div class="post-metadata">

**Author:** ![jzr](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@jzr](https://discourse.julialang.org/u/jzr)\
**Post date:** [April 30, 2021, 1:33am UTC](https://discourse.julialang.org/t/julian-design-for-api-library-with-websocket-client/60281/2 "2021-04-30T01:33:18Z")

</div>

Have you looked at [Channels](https://docs.julialang.org/en/v1/manual/asynchronous-programming/)?

---

<div class="post-metadata">

**Author:** ![Spirarel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/spirarel/32/23753_2.png) [@Spirarel](https://discourse.julialang.org/u/Spirarel)\
**Post date:** [May 1, 2021, 12:00am UTC](https://discourse.julialang.org/t/julian-design-for-api-library-with-websocket-client/60281/3 "2021-05-01T00:00:15Z")

</div>

I remember reading about them when I first got into Julia, but the thought didn’t cross my mind to use them here. The pub/sub model is exactly what I’m going for though. Thanks!
