-
Notifications
You must be signed in to change notification settings - Fork 111
Minor updates #283
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
Minor updates #283
Conversation
@@ -477,16 +497,31 @@ class GreetingWorkflow: | |||
async def current_greeting(self) -> str: | |||
return self._current_greeting | |||
|
|||
``` | |||
|
|||
This assumes there's an activity in `my_activities.py` like: |
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.
nit: Why do activities need the my_
prefix and workflows don't?
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.
I don't specify a workflow file name in this section. If you're talking about the quick start section, neither needs a my_
prefix. I chose to add it here for clarity since it's not an end-to-end example.
In order for a non-local activity to be notified of cancellation requests, it must be given a `heartbeat_timeout` at | ||
invocation time and invoke `temporalio.activity.heartbeat()` inside the activity. It is strongly recommended that all |
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.
That's not true, you don't have to specify a heartbeat_timeout
in order to be cancellable.
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.
I know that it's not strictly true but the sentence reads better with "must X and Y" than "must Y and should X".
function regularly. "Types of Activities" has specifics on cancellation for asynchronous and synchronous activities. | ||
In order for a non-local activity to be notified of cancellation requests, it must be given a `heartbeat_timeout` at | ||
invocation time and invoke `temporalio.activity.heartbeat()` inside the activity. It is strongly recommended that all | ||
but the fastest executing activities call this function regularly. "Types of Activities" has specifics on cancellation |
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.
nit: you might want to mention throttling here, up to you.
f"Cannot access {qualified_name} from inside a workflow. " | ||
"If this is code from a module not used in a workflow or known to " | ||
"only be used deterministically from a workflow, mark the import " | ||
"as pass through." |
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.
nit: I'd consider linking to some doc that provides more information.
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.
I have no stable link I can provide here
What was changed
heartbeat_timeout
is needed on caller side when wanting heartbeat/cancellation for activities (even if not technically required)Checklist