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

Class CancelFlightServer

python/pyarrow/tests/test_flight.py:2385–2399  ·  view source on GitHub ↗

A server for testing StopToken.

Source from the content-addressed store, hash-verified

2383
2384
2385class CancelFlightServer(FlightServerBase):
2386 """A server for testing StopToken."""
2387
2388 def do_get(self, context, ticket):
2389 schema = pa.schema([])
2390 rb = pa.RecordBatch.from_arrays([], schema=schema)
2391 return flight.GeneratorStream(schema, itertools.repeat(rb))
2392
2393 def do_exchange(self, context, descriptor, reader, writer):
2394 schema = pa.schema([])
2395 rb = pa.RecordBatch.from_arrays([], schema=schema)
2396 writer.begin(schema)
2397 while not context.is_cancelled():
2398 writer.write_batch(rb)
2399 time.sleep(0.5)
2400
2401
2402@pytest.mark.threading

Callers 1

test_interruptFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_interruptFunction · 0.68