1. 21 Jan, 2020 1 commit
  2. 18 Jan, 2020 1 commit
  3. 13 Dec, 2019 1 commit
  4. 10 Dec, 2019 2 commits
  5. 06 Dec, 2019 3 commits
  6. 05 Dec, 2019 4 commits
    • Kenton Varda's avatar
      Use Win32 fibers on Cygwin. · 53d21772
      Kenton Varda authored
      While swapcontext() exists on Cygwin, it seems that throwing an exception in a stack other than the main stack leads to a hang. But the Win32 fiber API seems to work fine.
      53d21772
    • Kenton Varda's avatar
      Implement fibers on Windows. · 609679fb
      Kenton Varda authored
      It was so easy that it compiled on the first try and almost totally worked... only thing I missed was calling switchToMain() explicitly at the end of the fiber main func.
      609679fb
    • Kenton Varda's avatar
      Implement fibers on Unix. · e8a14a7a
      Kenton Varda authored
      Fibers allow code to be written in a synchronous / blocking style while running inside the KJ event loop, by executing the code on an alternate call stack and switching back to the main stack whenever it waits.
      
      We introduce a new function, `kj::startFiber(stackSize, func)`. `func` is executed on the fiber stack. It is passed as its parameter a `WaitScope&`, which can then be passed into the `.wait()` method of any promise in order to wait on the promise in a blocking style. `startFiber()` returns a promise for the eventual value returned by `func()` (much as `evalLater()` and friends do).
      
      This commit implements fibers on Unix via ucontext_t. Windows will come next (and will probably be easier...).
      e8a14a7a
    • faywong's avatar
      remove kj-test(contains _main) from LIBRARIES · 870d8236
      faywong authored
      as kj/test.c++ contains "KJ_MAIN(kj::TestRunner);", this will generate the main entry for a process, so as to hidden the one defined in the main program(which is maybe the most common use case of CAPNP_LIBRARIES)
      870d8236
  7. 04 Dec, 2019 1 commit
    • Kenton Varda's avatar
      Refactor: Promise should have fewer friends. · c28fb99c
      Kenton Varda authored
      Instead of making `Promise` friend everything that needs to construct a `Promise<T>` from an `Own<PromiseNode>` or vice versa, let's just friend `PromiseNode` itself -- which is already a "private" class by virtue of being in the `_` namespace -- and let it provide some static methods to do the conversions.
      c28fb99c
  8. 27 Nov, 2019 2 commits
  9. 15 Nov, 2019 1 commit
  10. 14 Nov, 2019 1 commit
    • Kenton Varda's avatar
      Fix RPC loopback bootstrap(). · 77a57f8c
      Kenton Varda authored
      When VatNetwork::connect() returns nullptr, it means that the caller is trying to connect to itself.
      
      rpc-test.c++ failed to test this in two ways:
      - The test VatNetwork's connect() never returned null.
      - There was no test case for loopback connect.
      
      As a result, the code to handle loopback in rpc.c++ had bitrotted. It failed to handle the new bootstrap mechanism introduced in v0.5, and instead only implemented the restorer mechanism from 0.4.
      77a57f8c
  11. 11 Nov, 2019 4 commits
  12. 08 Nov, 2019 1 commit
  13. 07 Nov, 2019 1 commit
  14. 01 Nov, 2019 1 commit
  15. 31 Oct, 2019 1 commit
    • Joe Lee's avatar
      Make HttpClient adapter preserve exception behavior · ea4dc7f0
      Joe Lee authored
      Ideally, the HttpClient/HttpServer adapters should maintain the invariant that
      the behavior of a given client is the same as the behavior of
      newHttpClient(newHttpService(client)).  Prior to this change, the HttpClient
      wrapper lazily called request(), so a client whose request() eagerly threw an
      exception could produce a different exception when called directly versus when
      wrapped -- the laziness allowed additional code to run.  This was particularly
      evident when making a request with a body, since code using a wrapped client
      would be able to set up a subsequent BlockedWrite, eventually resulting in a
      "read end of pipe was aborted" exception instead of the actual exception.
      
      This change makes HttpClientAdapter::request() execute the wrapped request()
      eagerly.
      
      (Note that it partially undoes 90d48343... Hopefully, it preserves the desired
      behavior added there.)
      ea4dc7f0
  16. 28 Oct, 2019 4 commits
  17. 23 Oct, 2019 1 commit
  18. 22 Oct, 2019 4 commits
  19. 15 Oct, 2019 2 commits
  20. 14 Oct, 2019 4 commits