Skip to content

[DNM] Go SDK examples #1146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

[DNM] Go SDK examples #1146

wants to merge 14 commits into from

Conversation

nolag
Copy link
Collaborator

@nolag nolag commented Apr 17, 2025

To see the test only, diff against rtinianov_feature_sdk_vf.

@nolag nolag force-pushed the rtinianov_sdk_with_examples branch from b1f4032 to 967e015 Compare April 22, 2025 14:17
@nolag nolag changed the title [DNM] Go SDK with examples [DNM] Go SDK examples Apr 22, 2025
@nolag nolag force-pushed the rtinianov_sdk_with_examples branch 2 times, most recently from 9bec3f2 to 9288d44 Compare April 22, 2025 20:00
Makefile Outdated
@@ -1,6 +1,6 @@
.PHONY: gomods
gomods: ## Install gomods
go install github.com/jmank88/[email protected].5
go install github.com/jmank88/[email protected].3
Copy link
Collaborator

Choose a reason for hiding this comment

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

Accidental downgrade?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh the whole file actually

Comment on lines 7 to 14
type Promise[T any] interface {
Await() (T, error)
CapabilityPromise
}

type CapabilityPromise interface {
promise()
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it important to prevent user created Promises?

If it is not strictly necessary, then this sort of flexibility would be nice:

Suggested change
type Promise[T any] interface {
Await() (T, error)
CapabilityPromise
}
type CapabilityPromise interface {
promise()
}
type Promise[T any] func() (T, error)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is it important to prevent user created Promises?

Oh but they could just call the constructors below anyways?

return &basicPromise[T]{resolved: result, err: err, isResolved: true}
}

type basicPromise[T any] struct {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this behave differently than sync.OnceValues? It seems like we could leverage that, or even just expect callers to use it directly instead.

@nolag nolag changed the base branch from main to rtinianov_wasi May 5, 2025 18:43
@nolag nolag force-pushed the rtinianov_sdk_with_examples branch from a518da6 to da384fb Compare May 5, 2025 18:46
@nolag nolag temporarily deployed to integration May 5, 2025 18:46 — with GitHub Actions Inactive
@nolag nolag force-pushed the rtinianov_sdk_with_examples branch from f50b735 to 4485ad2 Compare May 6, 2025 13:51
@nolag nolag temporarily deployed to integration May 6, 2025 13:52 — with GitHub Actions Inactive
Base automatically changed from rtinianov_wasi to main May 6, 2025 18:03
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.

2 participants