An echo server that streams the whole table.
| 249 | |
| 250 | |
| 251 | class EchoTableStreamFlightServer(EchoFlightServer): |
| 252 | """An echo server that streams the whole table.""" |
| 253 | |
| 254 | def do_get(self, context, ticket): |
| 255 | return flight.GeneratorStream( |
| 256 | self.last_message.schema, |
| 257 | [self.last_message]) |
| 258 | |
| 259 | def list_actions(self, context): |
| 260 | return [] |
| 261 | |
| 262 | def do_action(self, context, action): |
| 263 | if action.type == "who-am-i": |
| 264 | return [context.peer_identity(), context.peer().encode("utf-8")] |
| 265 | raise NotImplementedError |
| 266 | |
| 267 | |
| 268 | class EchoRecordBatchReaderStreamFlightServer(EchoFlightServer): |
no outgoing calls