mirror of
https://github.com/fjvallarino/monomer.git
synced 2024-09-11 12:05:35 +03:00
Remove old paragraph from Ticker's readme (#23)
This commit is contained in:
parent
88e12a8d9b
commit
bb312efacb
@ -20,10 +20,10 @@ On startup a channel is created. It is used to send subscribe/unsubscribe
|
||||
requests to the thread handling the communication with the remote API.
|
||||
|
||||
During the `TickerInit` event, a `Producer` is launched. This producer, which
|
||||
runs on a separate thread from the application as `Task` do, performs these
|
||||
steps:
|
||||
runs on a separate thread from the application the same way `Task` instances do,
|
||||
performs these steps:
|
||||
|
||||
- Connects to the websockets API.
|
||||
- Connects to Binance's websockets API.
|
||||
- Launches a new thread for receiving ticker data. A separate thread is required
|
||||
because the producer also needs to receive messages from the application.
|
||||
- Subscribes to the initial ticker list.
|
||||
@ -45,15 +45,3 @@ The `TickerIgnore` event is used in Tasks that process errors and don't
|
||||
currently feed information into the application. In general you will want to
|
||||
report these errors to the user, but logging them may be enough at prototyping
|
||||
time.
|
||||
|
||||
One way to do this is to:
|
||||
|
||||
- Launch an extra thread (forkIO) before calling `receiveWs`.
|
||||
- Have `receiveWs` write to a channel where this new thread listens to, instead
|
||||
of directly writing to the application with `sendMsg`.
|
||||
- Use `threadDelay` on the new thread to wait for as long as desired, and read
|
||||
the available messages from the channel without blocking (`tryReadTChan`).
|
||||
Only then, if new messages were indeed received, send a single message with
|
||||
all the results to the application (`TickerUpdate` will have to be modified to
|
||||
receive a list instead of a single message). Use `forever` to repeat while the
|
||||
application is running.
|
||||
|
Loading…
Reference in New Issue
Block a user