RunnerArguments: add handle_sigint/handle_sigterm

This commit is contained in:
Aleix Conchillo Flaqué
2025-08-05 13:59:38 -07:00
parent 2981afb117
commit e2a576beca
2 changed files with 11 additions and 2 deletions

View File

@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Added new `handle_sigint` and `handle_sigterm` to `RunnerArguments`. This
allows applications to know what settings they should use for the environment
they are running on.
- Added `processor` field to `ErrorFrame` to indicate `FrameProcessor` that - Added `processor` field to `ErrorFrame` to indicate `FrameProcessor` that
generated the error. generated the error.

View File

@@ -10,7 +10,7 @@ These types are used by the development runner to pass transport-specific
information to bot functions. information to bot functions.
""" """
from dataclasses import dataclass from dataclasses import dataclass, field
from typing import Any from typing import Any
from fastapi import WebSocket from fastapi import WebSocket
@@ -20,7 +20,12 @@ from fastapi import WebSocket
class RunnerArguments: class RunnerArguments:
"""Base class for runner session arguments.""" """Base class for runner session arguments."""
pass handle_sigint: bool = field(init=False)
handle_sigterm: bool = field(init=False)
def __post_init__(self):
self.handle_sigint = True
self.handle_sigterm = False
@dataclass @dataclass