@@ -82,7 +82,7 @@ def __init__(self, callback_max_workers: int = 4):
82
82
def _generate_handle (self ) -> str :
83
83
return str (uuid4 ())
84
84
85
- def send_message (self , message : T , target : str , ** kwargs : Any ) -> None :
85
+ def send_message (self , message : T , target : str , ** kwargs : Optional [ Any ] ) -> None :
86
86
"""Implements publish pattern.
87
87
88
88
Sends a message to one or more subscribers. The target parameter
@@ -93,7 +93,9 @@ def send_message(self, message: T, target: str, **kwargs: Any) -> None:
93
93
"""
94
94
raise NotImplementedError ("This method should be implemented by the subclass." )
95
95
96
- def receive_message (self , source : str , timeout_sec : float , ** kwargs : Any ) -> T :
96
+ def receive_message (
97
+ self , source : str , timeout_sec : float , ** kwargs : Optional [Any ]
98
+ ) -> T :
97
99
"""Implements subscribe pattern.
98
100
99
101
Receives a message from a publisher. The source parameter
@@ -109,7 +111,7 @@ def register_callback(
109
111
source : str ,
110
112
callback : Callable [[T | Any ], None ],
111
113
raw : bool = False ,
112
- ** kwargs : Any ,
114
+ ** kwargs : Optional [ Any ] ,
113
115
) -> str :
114
116
"""Implements register callback.
115
117
@@ -173,7 +175,7 @@ def general_callback_preprocessor(self, message: Any) -> T:
173
175
raise NotImplementedError ("This method should be implemented by the subclass." )
174
176
175
177
def service_call (
176
- self , message : T , target : str , timeout_sec : float , ** kwargs : Any
178
+ self , message : T , target : str , timeout_sec : float , ** kwargs : Optional [ Any ]
177
179
) -> BaseMessage :
178
180
"""Implements request-response pattern.
179
181
@@ -190,7 +192,7 @@ def create_service(
190
192
service_name : str ,
191
193
on_request : Callable ,
192
194
on_done : Optional [Callable ] = None ,
193
- ** kwargs : Any ,
195
+ ** kwargs : Optional [ Any ] ,
194
196
) -> str :
195
197
"""Sets up a service endpoint for handling requests.
196
198
@@ -207,7 +209,7 @@ def create_action(
207
209
self ,
208
210
action_name : str ,
209
211
generate_feedback_callback : Callable ,
210
- ** kwargs : Any ,
212
+ ** kwargs : Optional [ Any ] ,
211
213
) -> str :
212
214
"""Sets up an action endpoint for long-running operations.
213
215
@@ -227,7 +229,7 @@ def start_action(
227
229
on_feedback : Callable ,
228
230
on_done : Callable ,
229
231
timeout_sec : float ,
230
- ** kwargs : Any ,
232
+ ** kwargs : Optional [ Any ] ,
231
233
) -> str :
232
234
"""Initiates a long-running operation with feedback.
233
235
@@ -240,7 +242,7 @@ def start_action(
240
242
"""
241
243
raise NotImplementedError ("This method should be implemented by the subclass." )
242
244
243
- def terminate_action (self , action_handle : str , ** kwargs : Any ) -> Any :
245
+ def terminate_action (self , action_handle : str , ** kwargs : Optional [ Any ] ) -> Any :
244
246
"""Cancels an ongoing action.
245
247
246
248
Stops the execution of a previously started action.
0 commit comments