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