mirror of
https://github.com/norohind/AudioControl.git
synced 2025-04-12 05:00:01 +03:00
25 lines
907 B
Python
25 lines
907 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Callable
|
|
|
|
import Events
|
|
|
|
|
|
class TransportABC(ABC):
|
|
@abstractmethod
|
|
def __init__(self, rcv_callback: Callable[[Events.ClientToServerEvent], None]):
|
|
"""Should call rcv_callback in order to pass received from client event"""
|
|
|
|
@abstractmethod
|
|
def send(self, msg: Events.ServerToClientEvent):
|
|
"""This method gets called by `ServerSideView` when it has an event to send to client"""
|
|
|
|
@abstractmethod
|
|
def tick(self):
|
|
"""This method get called by `ServerSideView` every little piece of time in order to allow
|
|
`Transport` to handle inbound messages (or other stuff `Transport` should do continuously"""
|
|
|
|
@abstractmethod
|
|
def shutdown(self):
|
|
"""Gets called by `ServerSideView` on program shutdown, the class should clean up all connections
|
|
and such staff"""
|