Skip to content

POC request/response pattern - #1228

Draft
ischneider wants to merge 1 commit into
mainfrom
dispatcher-poc
Draft

ischneider wants to merge 1 commit into
mainfrom
dispatcher-poc

Conversation

@ischneider

Copy link
Copy Markdown
Member

This is a (very) incomplete POC of how we might introduce request/response pattern and have a much smaller sync/async footprint.

To test, find one of your own searches and replace the ID in the example before running.

In your IDE, you should get various completion and correct hints for the functions.

Discussion:

  • rather than rework the Session to accommodate this new pattern, I just used httpx directly and put some retries in to avoid 429s - pretend we use the session directly in a real implementation
  • we'd add more request support, e.g. JSON that makes it easy to declare a request data class that gets serialized and post/put to a url
  • need to figure out a nice way to support pagination in a way the existing models/client do
  • while there's some typing/generic wonkyness , this shouldn't really concern consumers of the library
  • naming is hard but I think naming request objects as their corresponding openapi/client operations and keeping responses without Response suffix should work though it might be nice to separate requests + response types into separate modules, e.g. (with a flatter module layout than this POC) import planet.data.requests as data

@ischneider
ischneider marked this pull request as draft September 16, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant