refactor: Improve WebSocket support with implementation and documentation improvements

- Add create_websocket() method in client for simplified WebSocket management
- Expand WebSocket service with set_websocket() and find_websocket() methods
- Improve event handling and logging in WebSocketManager
- Add WebSocketConfig and WebSocketInfo models for event configuration
This commit is contained in:
Davidson Gomes
2025-03-06 09:47:44 -03:00
parent b0131a1141
commit 15e229cfb4
3 changed files with 127 additions and 44 deletions

View File

@@ -0,0 +1,20 @@
from typing import List, Optional
from dataclasses import dataclass
@dataclass
class WebSocketConfig:
enabled: bool
events: List[str]
def __init__(self, enabled: bool, events: List[str]):
self.enabled = enabled
self.events = events
@dataclass
class WebSocketInfo:
enabled: bool
events: List[str]
def __init__(self, **kwargs):
self.enabled = kwargs.get('enabled', False)
self.events = kwargs.get('events', [])