WebSocket Heartbeat

The websockets Discord API expects clients to send a “heartbeat” every X milliseconds (it’s around a minute) to keep the connection alive. How can I (using WebSockets.jl or the HTTP.WebSockets module) send a websocket message containing the heartbeat in fixed intervals while still receiving events and also sometimes sending other messages?