Skip to content

Commit 75871bf

Browse files
authored
Merge pull request #14 from bpringe/update-docs
Update docs
2 parents 1138b05 + 393aff8 commit 75871bf

File tree

4 files changed

+57
-82
lines changed

4 files changed

+57
-82
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ From here you can call any of the functions (provided your client has a valid ke
5959

6060
### Websocket Feed
6161

62-
Websocket messages are passed as edn to your `on-receive` function. When a new connection is created, the heartbeat channel is subscribed to if no `:channel` is specified.
62+
When a new connection is created, the heartbeat channel is subscribed to if no `:channel` is specified. The following list describes the callback functions that can be passed to `create-websocket-connection`:
63+
64+
- `:on-receive` - A unary function called when a message is received. The argument is received as edn.
65+
- `:on-connect` - A unary function called after the connection has been established. The argument is a [WebSocketSession](https://www.eclipse.org/jetty/javadoc/9.4.8.v20171121/org/eclipse/jetty/websocket/common/WebSocketSession.html).
66+
- `:on-error` - A unary function called in case of errors. The argument is a `Throwable` describing the error.
67+
- `:on-close` - A binary function called when the connection is closed. Arguments are an `int` status code and a `String` description of reason.
6368

6469
```clojure
6570
;; Create a new connection and subscribe to the ticker channel for BTC-USD

0 commit comments

Comments
 (0)