Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Pollable variant of RPC functions #49

Merged
merged 8 commits into from
Jun 24, 2024
Merged

Pollable variant of RPC functions #49

merged 8 commits into from
Jun 24, 2024

Conversation

vigoo
Copy link
Contributor

@vigoo vigoo commented Jun 14, 2024

Part of golemcloud/golem#175

Changes the generated stubs in the following way:

  • functions that return () already had two variants: blocking_xyz used invoke-and-await under the hood while xyz just used invoke to enqueue the invocation and return immeditaly.
  • with this change, functions not returning () also have two variants: blocking_xyz is what was previously xyz - uses invoke-and-await under the hood and blocks until it gets aresponse.
  • The xyz variant now returns a resource which have a subscribe and a get method - subscribe returns a pollable which can be used to wait until we get a response - get returns None if there is no response yet.

I plan to add helpers to the language-specific Golem wrappers (like golem-rust and golem-ts) to help processing these pollable responses in a more language idiomatic way.

@vigoo vigoo merged commit 927bacd into main Jun 24, 2024
2 checks passed
@vigoo vigoo deleted the vigoo/pollable-rpc branch June 24, 2024 11:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants