5 ms·
The concept of database cursor, or more generally continuation token, has been around a long time. Jumping to pub/sub is missing the mark. You can have RPC pro
by michaelsbradley 10mo ago
The concept of database cursor, or more generally continuation token, has been around a long time. Jumping to pub/sub is missing the mark.
You can have RPC prompt(input) return an opaque cursor, and promptNext(cursor) which returns partial output and the next cursor. As appropriate, the client could specify the desired size of output chunks along with input. The server could advertise or have documented the grace period for exhausting the cursors, but that’s not strictly necessary as it could be indicated in a promptNext(cursor) call that failed because of timeout. Transport session reuse can be handled automatically by HTTP.
When client receives output from a promptNext call it can work on updating the UI while promptNext is dispatched again in the background.