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