$52 GRAYBYTE WORDPRESS FILE MANAGER $99

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.217.149
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/burster/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/burster//notify.py
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2023 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
from typing import Callable, Protocol


class Signal(Protocol):
    def register(self, listener: Callable) -> Callable:
        ...

    # def unregister(self, listener: Callable) -> Callable:
    #     ...


class Emitter(Signal):
    # NOTE(vlebedev): registering a listener will keep it alive (i.e. not being garbage collected)
    #                 until it's explicitly unregistered.

    def __init__(self):
        self._listeners = set()

    def register(self, listener: Callable):
        if not callable(listener):
            raise ValueError("Listener must be callable")
        self._listeners.add(listener)
        return listener

    # TODO(vlebedev): Might be problems with references to e.g. class methods.
    #                 It's not that obvious how to handle them properly as they are transient/ephemeral.
    #                 For more info have a look at https://docs.python.org/3/library/weakref.html#weakref.WeakMethod
    # def unregister(self, listener: Callable):
    #     self._listeners.discard(listener)
    #     return listener

    def __call__(self, *args, **kwargs) -> None:
        exceptions = []
        for listener in tuple(self._listeners):
            if listener is None:
                continue
            try:
                listener(*args, **kwargs)
            except Exception as e:
                exceptions.append(e)

        if exceptions:
            raise ExceptionGroup("Exceptions occurred in listeners", exceptions)


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
5 Mar 2026 11.53 PM
root / root
0755
__pycache__
--
5 Mar 2026 11.53 PM
root / root
0755
storage
--
5 Mar 2026 11.53 PM
root / root
0755
__init__.py
8.529 KB
17 Feb 2026 11.00 AM
root / root
0644
_logs.py
0.583 KB
17 Feb 2026 11.00 AM
root / root
0644
adjust.py
7.362 KB
17 Feb 2026 11.00 AM
root / root
0644
common.py
4.559 KB
17 Feb 2026 11.00 AM
root / root
0644
config.py
7.96 KB
17 Feb 2026 11.00 AM
root / root
0644
history.py
9.795 KB
17 Feb 2026 11.00 AM
root / root
0644
lve_sm.py
18.402 KB
17 Feb 2026 11.00 AM
root / root
0644
lves_tracker.py
8.925 KB
17 Feb 2026 11.00 AM
root / root
0644
notify.py
1.64 KB
17 Feb 2026 11.00 AM
root / root
0644
overload.py
3.231 KB
17 Feb 2026 11.00 AM
root / root
0644
profiler.py
10.299 KB
17 Feb 2026 11.00 AM
root / root
0644
utils.py
1.626 KB
17 Feb 2026 11.00 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF