WebSocket Pinnacle stabile: prezzi stale e riconnessione
Risposta: tratta il socket come trasporto inaffidabile. (1) Rispondi a ogni ping con {"type":"pong"}. (2) Su close, backoff esponenziale + jitter, reiscriviti, svuota le map allo snapshot part === 1. (3) Traccia seq/ts e l'ultimo apply — se il silenzio supera il tuo SLA, forza la riconnessione. (4) Onora i codici (1001 deploy, 4008 slow consumer). Serve Builder (99 €/mese). Esempio Node: riconnessione.
Stale-price detection (client-side)#
import time
LAST = {"ts": 0.0}
STALE_SEC = 15 # your SLA — not a vendor latency claim
def on_message(msg):
if msg["type"] in ("snapshot", "delta", "ping"):
LAST["ts"] = time.time()
def watchdog():
if time.time() - LAST["ts"] > STALE_SEC:
raise TimeoutError("no frames; reconnect")
Quiet markets are normal — gate the watchdog on whether events you care about are live.
Failure modes#
| Signal | Action |
|---|---|
No pong path | Socket dies ~60 s after missed ping |
4008 slow_consumer | Narrow filters or speed up handlers |
1001 server_shutdown | Backoff reconnect (deploy) |
| Snapshot without clear | Ghost markets from the previous session |
We do not publish latency versus named competitors. Measure tick → your handler yourself.
CTA#
Builder. 3-day trial; card required, charged after day 3 unless cancelled. Docs: WebSocket.
Domande frequenti#
Lo scraping guest basta?#
Ban e board guest ritardate sono fallimenti comuni. Una chiave self-serve con codici di chiusura documentati è il percorso supportato.
Garantite aggiornamenti sotto il secondo?#
Documentiamo heartbeat e tipi di frame, non un RTT di marketing verso altri reseller. Strumenta end-to-end.
Contenuto educativo per adulti?#
Sì (18+).
Contenuto educativo per maggiorenni (18+): non pronostici né promesse di guadagno. In Italia scommetti solo con operatori autorizzati ADM.