@@ -224,20 +224,21 @@ async def process_input_stream(
224224 request_count = 0
225225 async for request in request_iterator :
226226 request_count += 1
227- # check whether the request is an open or append operation
228- if request .operation is int (WindowOperation .OPEN ):
229- # create a new task for the open operation and
230- # put the request in the task iterator
231- await self .create_task (request )
232- elif request .operation is int (WindowOperation .APPEND ):
233- # append the task data to the existing task
234- # if the task does not exist, create a new task
235- await self .send_datum_to_task (request )
236- elif request .operation is int (WindowOperation .CLOSE ):
237- # close the current task for req
238- await self .close_task (request )
239- else :
240- _LOGGER .debug (f"No operation matched for request: { request } " , exc_info = True )
227+ # check whether the request is an open, append, or close operation
228+ match request .operation :
229+ case int (WindowOperation .OPEN ):
230+ # create a new task for the open operation and
231+ # put the request in the task iterator
232+ await self .create_task (request )
233+ case int (WindowOperation .APPEND ):
234+ # append the task data to the existing task
235+ # if the task does not exist, create a new task
236+ await self .send_datum_to_task (request )
237+ case int (WindowOperation .CLOSE ):
238+ # close the current task for req
239+ await self .close_task (request )
240+ case _:
241+ _LOGGER .debug (f"No operation matched for request: { request } " , exc_info = True )
241242
242243 # If there is an error in the accumulator operation, log and
243244 # then send the error to the result queue
0 commit comments