code: def chat(ws):
      
      lag_tolerance_secs = float(request.args.get("tolerance", 0.1))
      client = Client(ws, lag_tolerance_secs=lag_tolerance_secs)
      client.subscribe(request.args.get("channel"))
      gevent.spawn(client.heartbeat)
      client.publish()
docs: Relay chat messages to and from clients.