1. 18 Jun, 2019 4 commits
    • Kenton Varda's avatar
      Add client-side streaming hooks. · 56493100
      Kenton Varda authored
      Also, push harder on the code generator such that `StreamResult` doesn't show up in generated code at all.
      
      So now we have `StreamingRequest<Params>` which is like `Request<Params, Results>`, and we have `StreamingCallContext<Params>` which is like `CallContext<Params, Results>`.
      56493100
    • Kenton Varda's avatar
      Implement server side of streaming. · c3cfe9e5
      Kenton Varda authored
      There are two things that every capability server must implement:
      
      * When a streaming method is delivered, it blocks subsequent calls on the same capability. Although not strictly needed to achieve flow control, this simplifies the implementation of streaming servers -- many would otherwise need to implement such serialization manually.
      * When a streaming method throws, all subsequent calls also throw the same exception. This is important because exceptions thrown by a streaming call might not actually be delivered to a client, since the client doesn't necessarily wait for the results before making the next call. Again, a streaming server could implement this manually, but almost all streaming servers will likely need it, and this makes things easier.
      c3cfe9e5
    • Kenton Varda's avatar
      Regenerate bootstraps for streaming. · a784f2f7
      Kenton Varda authored
      Note: Apparently, json.capnp had not been added to the bootstrap test, and the checked-in bootstrap had drifted from the source file.
      a784f2f7
    • Kenton Varda's avatar
      Introduce new 'stream' keyword. · bd6d75ba
      Kenton Varda authored
      This can be used on a method to indicate that it is used for "streaming", like:
      
          write @0 (bytes :Data) -> stream;
      
      A "streaming" method is one which is expected to be called many times to transmit an ordered stream of items. For best throughput, it is often necessary to make multiple overlapping calls, so as not to wait for a round trip for every item. However, to avoid excess buffering, it may be necessary to apply backpressure by having the client limit the total number of overlapping calls. This logic is difficult to get right at the application level, so making it a language feature gives us the opportunity to implement it in the RPC layer.
      
      We can, however, do it in a way that is backwards-compatible with implementations that don't support it. The above declaration is equivalent to:
      
          write @0 (bytes :Data) -> import "/capnp/stream.capnp".StreamResult;
      
      RPC implementations that don't explicitly support streaming can thus instead leave it up to the application to handle.
      bd6d75ba
  2. 15 Apr, 2019 1 commit
  3. 10 Mar, 2019 1 commit
  4. 17 Nov, 2018 1 commit
  5. 26 Aug, 2018 2 commits
  6. 25 Aug, 2018 1 commit
  7. 15 Aug, 2018 2 commits
  8. 12 Aug, 2018 1 commit
  9. 05 Aug, 2018 2 commits
  10. 24 Jun, 2018 1 commit
  11. 04 Jun, 2018 1 commit
    • Kenton Varda's avatar
      Support multi-part string literals in capnp. · 113fa5a6
      Kenton Varda authored
      I was shocked to find that there was no good way to represent a multi-line literal currently. This implements C-style literals, where multiple consecutive string literals are concatenated.
      113fa5a6
  12. 21 Apr, 2018 1 commit
  13. 19 Apr, 2018 1 commit
  14. 13 Mar, 2018 2 commits
  15. 25 Feb, 2018 1 commit
  16. 08 Feb, 2018 1 commit
  17. 11 Jan, 2018 1 commit
    • Kenton Varda's avatar
      Replace all include guards with #pragma once. · 677a52ab
      Kenton Varda authored
      @kloepper pointed out a while back that every compiler you've ever heard of supports this. Plus, it's more concise, it's not prone to copy-paste errors, and it looks nicer.
      
      At the time I wanted to remain consistent and I didn't feel like spending the time to update all my existing code. But, every time I've added a new header since I've cursed the include guard, so I finally broke down and changed it.
      677a52ab
  18. 23 Dec, 2017 8 commits
  19. 21 Dec, 2017 1 commit
    • Kenton Varda's avatar
      Tweak capnp-test to not rely on no-matching-prefix input. · 6d4107f4
      Kenton Varda authored
      Specifying input files that are not in the current directory and without specifying --src-prefix has always had pretty broken results: the compiler can actually break out of the specified output directory when creating output files! This will soon no longer be allowed.
      
      capnp-test, when run in an out-of-tree build, currently specifies such an unprefixed input, but got away with it because it was in the errors test, which doesn't actually output anything because there are input errors. We fix it by specifying a proper --src-prefix.
      6d4107f4
  20. 19 Oct, 2017 1 commit
  21. 12 Oct, 2017 1 commit
    • Ed Catmur's avatar
      Add include <wincrypt.h> · 33f53084
      Ed Catmur authored
      Visual Studio 2017 (14.11.25503, 19.11.25508.2) needs `#include <wincrypt.h>` for CryptGenRandom etc.
      33f53084
  22. 14 Aug, 2017 3 commits
  23. 28 Jul, 2017 2 commits
    • Kenton Varda's avatar
      Make old GCC happy. · 3bd11689
      Kenton Varda authored
      3bd11689
    • Kenton Varda's avatar
      Add new `capnp convert` command with JSON support. · c4c5e404
      Kenton Varda authored
      This supersedes the `capnp encode` and `capnp decode` commands. It didn't make sense to add JSON to those commands since it was unclear if JSON should be thought of as the "encoded" or "decoded" format. `convert` allows mapping anything to anything.
      
      This command is also useful for, say, converting unpacked format to packed format or vice versa, which can now be done without a schema.
      c4c5e404