Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental download-style streaming responses #110

Merged
merged 7 commits into from
Jun 22, 2018

Commits on Apr 23, 2018

  1. Get download-style streaming rpc working

    * Use "EncodeMessage" instead of "Marshal" in serve<methName>Protobuf so message length is written properly
    * Flush stream response after each message if response writer implements http.Flusher
    * Add streaming "MakeHats" endpoint to example service
    mikeylemmon committed Apr 23, 2018
    Configuration menu
    Copy the full SHA
    f6beb3c View commit details
    Browse the repository at this point in the history

Commits on May 21, 2018

  1. Use json-encoded twirp error for streaming trailers

    * Also, add tests for example server
    * JSON clients currently fail to stream (rpc call gets EOF err instead of RespStream)
    mikeylemmon committed May 21, 2018
    Configuration menu
    Copy the full SHA
    7ce9098 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2018

  1. Improve error handling in generated download-stream protobuf code

    * Add new "test_example" target to Makefile. Example tests are passing for protobuf clients; JSON tests would fail, but are commented out
    * Return normal twirp errors from download requests that fail before the stream is created
    * Consolidate generator logic for unary and download rpc types in generateServerProtobufMethod
    * In the example server, use chan of HatOrError type to send mid-stream errors
    mikeylemmon committed May 30, 2018
    Configuration menu
    Copy the full SHA
    966c23a View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2018

  1. generator: Use bytes.Buffer instead of strings.Builder for compatibil…

    …ity with older versions of go
    mikeylemmon committed Jun 4, 2018
    Configuration menu
    Copy the full SHA
    6547c31 View commit details
    Browse the repository at this point in the history

Commits on Jun 5, 2018

  1. Add New<Type>Stream constructor to generated .twirp.go files

    * Define `<Type>OrError` struct that is a union of the `<Type>` and `error` return values from `Next`
    * Define `New<Type>Stream` constructor that takes a channel of `<Type>OrError` and returns an implementation of the `<Type>Stream` interface
    mikeylemmon committed Jun 5, 2018
    Configuration menu
    Copy the full SHA
    8f561c5 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2018

  1. Configuration menu
    Copy the full SHA
    fe19e01 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2018

  1. Configuration menu
    Copy the full SHA
    b8fadd5 View commit details
    Browse the repository at this point in the history