summaryrefslogtreecommitdiff
path: root/examples/rel_client.py
blob: 9b9c7da6f6c7065ae151cb26aefbc57a2ea47b0b (plain)
1
2
3
4
5
6
7
8
9
10
11
import websocket
import rel

addr = "wss://api.gemini.com/v1/marketdata/%s"

if __name__ == "__main__":
    for symbol in ["BTCUSD", "ETHUSD", "ETHBTC"]:
        ws = websocket.WebSocketApp(addr % (symbol,), on_message=lambda w, m: print(m))
        ws.run_forever(dispatcher=rel)
    rel.signal(2, rel.abort)  # Keyboard Interrupt
    rel.dispatch()