I'd like to publish heartbeat messages on a set interval (like every 3 seconds), but at least using Greenlet's doesn't seem to work (nor gevent.core.timer). Looks like conn.read_frames() on connection blocks any other greenlet running. Any advice on getting something to run on a timeout?
The connection constructor takes a heartbeat= kwarg which you can use to enable heartbeats. If heartbeats are enabled then read_frames() will use that as the socket timeout. Additional kwargs are documented in the Functional Specifications section of the documentation.
For blocking sockets a future update will include an argument to read_frames() to allow the caller discrete control over socket timeouts.