MCPcopy Create free account
hub / github.com/apache/arrow / CancelFlightServer

Class CancelFlightServer

python/pyarrow/tests/test_flight.py:2423–2437  ·  view source on GitHub ↗

A server for testing StopToken.

Source from the content-addressed store, hash-verified

2421
2422
2423class CancelFlightServer(FlightServerBase):
2424 """A server for testing StopToken."""
2425
2426 def do_get(self, context, ticket):
2427 schema = pa.schema([])
2428 rb = pa.RecordBatch.from_arrays([], schema=schema)
2429 return flight.GeneratorStream(schema, itertools.repeat(rb))
2430
2431 def do_exchange(self, context, descriptor, reader, writer):
2432 schema = pa.schema([])
2433 rb = pa.RecordBatch.from_arrays([], schema=schema)
2434 writer.begin(schema)
2435 while not context.is_cancelled():
2436 writer.write_batch(rb)
2437 time.sleep(0.5)
2438
2439
2440@pytest.mark.threading

Callers 1

test_interruptFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_interruptFunction · 0.68