jmcore._notification_worker
jmcore._notification_worker
Isolated Apprise delivery worker for notifications.
Apprise HTTP plugins use process-global proxy environment variables. Keep that state in a dedicated child process so notifications cannot affect the parent JoinMarket process or any of its concurrent tasks.
Attributes
PROXY_ENVIRONMENT_KEYS = ('HTTP_PROXY', 'HTTPS_PROXY', 'http_proxy', 'https_proxy', 'ALL_PROXY', 'all_proxy', 'NO_PROXY', 'no_proxy')
module-attribute
Classes
AppriseWorker
A single-process, serialized Apprise delivery worker.
Source code in jmcore/src/jmcore/_notification_worker.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | |
Attributes
closed: bool
property
Return whether this worker has been shut down.
Methods:
__init__(config: NotificationWorkerConfig)
Source code in jmcore/src/jmcore/_notification_worker.py
300 301 302 303 304 305 306 307 | |
close() -> None
Stop the child without allowing shutdown to block indefinitely.
Source code in jmcore/src/jmcore/_notification_worker.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | |
send(title: str, body: str, priority: str) -> NotificationWorkerResult
Queue one serialized request and return its delivery result.
Source code in jmcore/src/jmcore/_notification_worker.py
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |
start() -> NotificationWorkerResult
Spawn the worker and wait for its Apprise initialization result.
Source code in jmcore/src/jmcore/_notification_worker.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | |
NotificationWorker
Bases: Protocol
Synchronous interface used by :class:jmcore.notifications.Notifier.
Source code in jmcore/src/jmcore/_notification_worker.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
Attributes
closed: bool
property
Whether the worker can no longer accept requests.
Methods:
close() -> None
Stop the worker and release its resources.
Source code in jmcore/src/jmcore/_notification_worker.py
106 107 108 | |
send(title: str, body: str, priority: str) -> NotificationWorkerResult
Deliver one notification.
Source code in jmcore/src/jmcore/_notification_worker.py
102 103 104 | |
start() -> NotificationWorkerResult
Start the worker and initialize its Apprise services.
Source code in jmcore/src/jmcore/_notification_worker.py
98 99 100 | |
NotificationWorkerConfig
dataclass
Configuration transferred to the isolated notification worker.
Source code in jmcore/src/jmcore/_notification_worker.py
68 69 70 71 72 73 74 75 76 | |
Attributes
stream_isolation: bool
instance-attribute
tor_socks_host: str
instance-attribute
tor_socks_port: int
instance-attribute
urls: tuple[str, ...]
instance-attribute
use_tor: bool
instance-attribute
NotificationWorkerResult
dataclass
A bounded delivery result that contains no notification content.
Source code in jmcore/src/jmcore/_notification_worker.py
79 80 81 82 83 84 85 86 87 | |
Attributes
diagnostic: str | None = None
class-attribute
instance-attribute
success: bool
instance-attribute
Methods:
__post_init__() -> None
Source code in jmcore/src/jmcore/_notification_worker.py
86 87 | |