An echo server that streams individual record batches.
| 234 | |
| 235 | |
| 236 | class EchoStreamFlightServer(EchoFlightServer): |
| 237 | """An echo server that streams individual record batches.""" |
| 238 | |
| 239 | def do_get(self, context, ticket): |
| 240 | return flight.GeneratorStream( |
| 241 | self.last_message.schema, |
| 242 | self.last_message.to_batches(max_chunksize=1024)) |
| 243 | |
| 244 | def list_actions(self, context): |
| 245 | return [] |
| 246 | |
| 247 | def do_action(self, context, action): |
| 248 | if action.type == "who-am-i": |
| 249 | return [context.peer_identity(), context.peer().encode("utf-8")] |
| 250 | raise NotImplementedError |
| 251 | |
| 252 | |
| 253 | class EchoTableStreamFlightServer(EchoFlightServer): |
no outgoing calls