feat(nodes): promote is_canceled to public node API

This commit is contained in:
psychedelicious 2024-02-18 11:25:00 +11:00
parent 2cb51bff11
commit 6a74048af8

View File

@ -437,11 +437,12 @@ class InvocationContext:
"""Provides utility methods."""
self.boards = boards
"""Provides methods to interact with boards."""
self.is_canceled = is_canceled
"""Checks if the current invocation has been canceled."""
self._data = context_data
"""Provides data about the current queue item and invocation. This is an internal API and may change without warning."""
self._services = services
"""Provides access to the full application services. This is an internal API and may change without warning."""
self._is_canceled = is_canceled
def build_invocation_context(
@ -457,6 +458,7 @@ def build_invocation_context(
"""
def is_canceled() -> bool:
"""Checks if the current invocation has been canceled."""
return cancel_event.is_set()
logger = LoggerInterface(services=services, context_data=context_data)