1. 13 Dec, 2019 1 commit
  2. 10 Dec, 2019 2 commits
  3. 06 Dec, 2019 3 commits
  4. 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
  5. 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
  6. 27 Nov, 2019 2 commits
  7. 15 Nov, 2019 1 commit
  8. 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
  9. 11 Nov, 2019 4 commits
  10. 08 Nov, 2019 1 commit
  11. 07 Nov, 2019 1 commit
  12. 01 Nov, 2019 1 commit
  13. 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
  14. 28 Oct, 2019 4 commits
  15. 23 Oct, 2019 1 commit
  16. 22 Oct, 2019 4 commits
  17. 15 Oct, 2019 2 commits
  18. 14 Oct, 2019 4 commits
  19. 04 Oct, 2019 2 commits