controller package#
Submodules#
controller.controller_def module#
Controller module (also referable to as ‘Application Controller’ module)
This module contains the class and module definitions for the Application Controller
- class controller.controller_def.Controller[source]#
Bases:
object
Class definition for application controller.
- async connect_ws(message=None)[source]#
Connects controller to websocket with web socket url
- Parameters:
message – Optional message to send to the websocket
- Returns:
- async static initialise(number_of_users: int, ws_url: str, chat_context: str) Controller [source]#
Constructor for Controller object.
The controller performs lightly as a Controller from the MVC Design Pattern https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller :param number_of_users: Number of users to participate in application lifecycle :param ws_url: Web socket url for Controller to interact with. :param chat_context: Group chat context
- property websocket#
Controller websocket getter.
- ws_url = None#
controller.kafka_manager_def module#
Kafka Manager module (also referable to as ‘Application Controller Kafka Manager’ module)
This module contains the class and module definitions for the Application Controller Kafka Manager
- class controller.kafka_manager_def.KafkaManager(number_of_users: int)[source]#
Bases:
object
- property consumers: Tuple[AIOKafkaConsumer]#
- property producers: Tuple[AIOKafkaProducer]#
- class controller.kafka_manager_def.KafkaManagerFactory[source]#
Bases:
object
Class definition for the kafka manager employed primarily by the application controller.
- static create_base_kafka_manager(number_of_users: int | None = None) KafkaManager [source]#
Create and return bare-minimum Kafka Manager object. :param number_of_users: Number of users participating in chat. :return: KafkaManager object.