Skip to content

More async interfaces#3428

Draft
itowlson wants to merge 3 commits intospinframework:mainfrom
itowlson:async-async-async
Draft

More async interfaces#3428
itowlson wants to merge 3 commits intospinframework:mainfrom
itowlson:async-async-async

Conversation

@itowlson
Copy link
Collaborator

What's in here:

  • Async variables
  • Async Redis
  • Async MQTT
  • I also tweaked the async KV error typing because I had let is get out of whack with other factors

What's not in here:

  • LLM (stuff like token streaming would be jolly useful, but I suspect that any vNext of this is going to involve some rethinking)
  • MySQL (the connection library we're using seems unenthusiastic about concurrency so this might take a bit more noodling)
  • Tests

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
// Poll event loop until outgoing publish event is iterated over to send the message to MQTT broker or capture/throw error.
// We may revisit this later to manage long running connections, high throughput use cases and their issues in the connection pool.
let mut lock = self.event_loop.lock().await;
loop {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what to do about this. Reading the code this seems like it would block further publish attempts until the previous one has resolved, which can't be the intention.

Maybe we need to redesign this to run an always-on background polling task, figure out how to link completions with publishes, and then do some future-based way to report errrors. I don't know MQTT well enough to be confident with any of this though...

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