Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
File size: 1,113 Bytes
2e813e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
// lib/services/websocket_core_interface.dart
/// This file provides a subset of WebSocket functionality needed for the nano player
/// It's a simplified version that avoids exposing the entire WebSocketApiService
/// WebSocketRequest model
class WebSocketRequest {
/// Request identifier
final String requestId;
/// Action to perform
final String action;
/// Parameters for the action
final Map<String, dynamic> params;
/// Constructor
WebSocketRequest({
required this.requestId,
required this.action,
required this.params,
});
/// Convert to JSON
Map<String, dynamic> toJson() => {
'requestId': requestId,
'action': action,
...params,
};
}
/// Extension methods for the WebSocketApiService
extension WebSocketApiServiceExtensions on dynamic {
/// Send a WebSocket request without waiting for a response
Future<void> sendRequestWithoutResponse(WebSocketRequest request) async {
// This method will be provided by the main WebSocketApiService class
// It's just a stub for compilation purposes
return Future.value();
}
} |