-
Notifications
You must be signed in to change notification settings - Fork 4
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
Ergonomics of timeoutSeconds
is rough
#130
Comments
I didn't like https://legacy-documentation-sdks.temporal.io/typescript/workflows#sleep // NOT VALID
await sleep('1 month'); // ms package doesnt support "months" https://github.com/vercel/ms/issues/57
// use date-fns and sleepUntil instead, see below While the english form it quite pretty, it:
What other options are there?
|
Are those really big enough problems to not support the ms format? You can paper over their rough edges and throw an error when it's milliseconds. Still might be better than forcing everyone to do calculations. It wouldn't have to be the only way - if people want to compute a time they can still use the seconds api. Is there a way in which we can support all of these use cases? Temporal api looks good - standardizing around iso format seems right. I guess for now we can leave it as it is - let people compute seconds and wait for it to be a problem and then discuss with users instead of extra breadth now. |
|
We only support a granularity of seconds, which is why our timeouts use
timeoutSeconds
, but libraries like ms return milliseconds. This leads to an unfortunate usage such as:Should we allow for a
timeout
property that accepts a string compatible withms
? Temporal also does this.The text was updated successfully, but these errors were encountered: