+struct io_plan io_idle(void);
+
+/**
+ * io_timeout - set timeout function if the callback doesn't fire.
+ * @conn: the current connection.
+ * @ts: how long until the timeout should be called.
+ * @cb to call.
+ * @arg: argument to @cb.
+ *
+ * If the usual next callback is not called for this connection before @ts,
+ * this function will be called. If next callback is called, the timeout
+ * is automatically removed.
+ *
+ * Returns false on allocation failure. A connection can only have one
+ * timeout.
+ */
+#define io_timeout(conn, ts, fn, arg) \
+ io_timeout_((conn), (ts), \
+ typesafe_cb_preargs(struct io_plan, void *, \
+ (fn), (arg), \
+ struct io_conn *), \
+ (arg))
+bool io_timeout_(struct io_conn *conn, struct timespec ts,
+ struct io_plan (*fn)(struct io_conn *, void *), void *arg);