-
Notifications
You must be signed in to change notification settings - Fork 20
[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
base: main
Are you sure you want to change the base?
[DNM] Go SDK examples #1146
Conversation
b1f4032
to
967e015
Compare
9bec3f2
to
9288d44
Compare
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidental downgrade?
There was a problem hiding this comment.
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
pkg/workflows/sdk/v2/promise.go
Outdated
type Promise[T any] interface { | ||
Await() (T, error) | ||
CapabilityPromise | ||
} | ||
|
||
type CapabilityPromise interface { | ||
promise() | ||
} |
There was a problem hiding this comment.
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 Promise
s?
If it is not strictly necessary, then this sort of flexibility would be nice:
type Promise[T any] interface { | |
Await() (T, error) | |
CapabilityPromise | |
} | |
type CapabilityPromise interface { | |
promise() | |
} | |
type Promise[T any] func() (T, error) |
There was a problem hiding this comment.
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?
pkg/workflows/sdk/v2/promise.go
Outdated
return &basicPromise[T]{resolved: result, err: err, isResolved: true} | ||
} | ||
|
||
type basicPromise[T any] struct { |
There was a problem hiding this comment.
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.
a518da6
to
da384fb
Compare
f50b735
to
4485ad2
Compare
To see the test only, diff against rtinianov_feature_sdk_vf.