Commit ae815524 authored by Kenton Varda's avatar Kenton Varda

Merge branch 'master' of github.com:kentonv/capnproto

parents f7a9c94b da5a1f4b
...@@ -172,11 +172,10 @@ public: ...@@ -172,11 +172,10 @@ public:
CapnpcCppMain(kj::ProcessContext& context): context(context) {} CapnpcCppMain(kj::ProcessContext& context): context(context) {}
kj::MainFunc getMain() { kj::MainFunc getMain() {
return kj::MainBuilder(context, "Cap'n Proto loopback plugin version " VERSION, return kj::MainBuilder(context, "Cap'n Proto C++ plugin version " VERSION,
"This is a Cap'n Proto compiler plugin which \"de-compiles\" the schema back into " "This is a Cap'n Proto compiler plugin which generates C++ code. "
"Cap'n Proto schema language format, with comments showing the offsets chosen by the " "It is meant to be run using the Cap'n Proto compiler, e.g.:\n"
"compiler. This is meant to be run using the Cap'n Proto compiler, e.g.:\n" " capnp compile -oc++ foo.capnp")
" capnp compile -ocapnp foo.capnp")
.callAfterParsing(KJ_BIND_METHOD(*this, run)) .callAfterParsing(KJ_BIND_METHOD(*this, run))
.build(); .build();
} }
......
...@@ -140,7 +140,7 @@ class EzRpcServer { ...@@ -140,7 +140,7 @@ class EzRpcServer {
// The server counterpart to `EzRpcClient`. See `EzRpcClient` for an example. // The server counterpart to `EzRpcClient`. See `EzRpcClient` for an example.
public: public:
explicit EzRpcServer(kj::StringPtr bindAddress, uint deafultPort = 0); explicit EzRpcServer(kj::StringPtr bindAddress, uint defaultPort = 0);
// Construct a new `EzRpcServer` that binds to the given address. An address of "*" means to // Construct a new `EzRpcServer` that binds to the given address. An address of "*" means to
// bind to all local addresses. // bind to all local addresses.
// //
...@@ -169,7 +169,7 @@ public: ...@@ -169,7 +169,7 @@ public:
// Export a capability publicly under the given name, so that clients can import it. // Export a capability publicly under the given name, so that clients can import it.
// //
// Keep in mind that you can implicitly convert `kj::Own<MyType::Server>&&` to // Keep in mind that you can implicitly convert `kj::Own<MyType::Server>&&` to
// `Capability::Client`, so it's typicall to pass something like // `Capability::Client`, so it's typical to pass something like
// `kj::heap<MyImplementation>(<constructor params>)` as the second parameter. // `kj::heap<MyImplementation>(<constructor params>)` as the second parameter.
kj::Promise<uint> getPort(); kj::Promise<uint> getPort();
......
...@@ -265,8 +265,6 @@ private: ...@@ -265,8 +265,6 @@ private:
// ======================================================================================= // =======================================================================================
class RpcConnectionState final: public kj::TaskSet::ErrorHandler, public kj::Refcounted { class RpcConnectionState final: public kj::TaskSet::ErrorHandler, public kj::Refcounted {
class PromisedAnswerClient;
public: public:
RpcConnectionState(kj::Maybe<SturdyRefRestorerBase&> restorer, RpcConnectionState(kj::Maybe<SturdyRefRestorerBase&> restorer,
kj::Own<VatNetworkBase::Connection>&& connectionParam, kj::Own<VatNetworkBase::Connection>&& connectionParam,
......
...@@ -420,21 +420,19 @@ struct Finish { ...@@ -420,21 +420,19 @@ struct Finish {
# Message type sent from the caller to the callee to indicate: # Message type sent from the caller to the callee to indicate:
# 1) The questionId will no longer be used in any messages sent by the callee (no further # 1) The questionId will no longer be used in any messages sent by the callee (no further
# pipelined requests). # pipelined requests).
# 2) Any capabilities in the results other than the ones listed below should be implicitly # 2) If the call has not returned yet, the caller no longer cares about the result. If nothing
# released. # else cares about the result either (e.g. there are no other outstanding calls pipelined on
# 3) If the call has not returned yet, the caller no longer cares about the result. If nothing
# else cares about the result either (e.g. there are to other outstanding calls pipelined on
# the result of this one) then the callee may wish to immediately cancel the operation and # the result of this one) then the callee may wish to immediately cancel the operation and
# send back a Return message with "canceled" set. However, implementations are not required # send back a Return message with "canceled" set. However, implementations are not required
# to support premature cancellation -- instead, the implementation may wait until the call # to support premature cancellation -- instead, the implementation may wait until the call
# actually completes and send a normal `Return` message. # actually completes and send a normal `Return` message.
# #
# TODO(someday): Should we separate (1) and (2)? It would be possible and useful to notify the # TODO(someday): Should we separate (1) and implicitly releasing result capabilities? It would be
# server that it doesn't need to keep around the response to service pipeline requests even # possible and useful to notify the server that it doesn't need to keep around the response to
# though the caller still wants to receive it / hasn't yet finished processing it. It could # service pipeline requests even though the caller still wants to receive it / hasn't yet
# also be useful to notify the server that it need not marshal the results because the caller # finished processing it. It could also be useful to notify the server that it need not marshal
# doesn't want them anyway, even if the caller is still sending pipelined calls, although this # the results because the caller doesn't want them anyway, even if the caller is still sending
# seems less useful (just saving some bytes on the wire). # pipelined calls, although this seems less useful (just saving some bytes on the wire).
questionId @0 :QuestionId; questionId @0 :QuestionId;
# ID of the call whose result is to be released. # ID of the call whose result is to be released.
......
...@@ -126,11 +126,11 @@ char* fill(char* __restrict__ target, const StringTree& first, Rest&&... rest) { ...@@ -126,11 +126,11 @@ char* fill(char* __restrict__ target, const StringTree& first, Rest&&... rest) {
template <typename T> constexpr bool isStringTree() { return false; } template <typename T> constexpr bool isStringTree() { return false; }
template <> constexpr bool isStringTree<StringTree>() { return true; } template <> constexpr bool isStringTree<StringTree>() { return true; }
inline StringTree&& toStringTreeOrCharSequnece(StringTree&& tree) { return kj::mv(tree); } inline StringTree&& toStringTreeOrCharSequence(StringTree&& tree) { return kj::mv(tree); }
inline StringTree toStringTreeOrCharSequnece(String&& str) { return StringTree(kj::mv(str)); } inline StringTree toStringTreeOrCharSequence(String&& str) { return StringTree(kj::mv(str)); }
template <typename T> template <typename T>
inline auto toStringTreeOrCharSequnece(T&& value) inline auto toStringTreeOrCharSequence(T&& value)
-> decltype(toCharSequence(kj::fwd<T>(value))) { -> decltype(toCharSequence(kj::fwd<T>(value))) {
static_assert(!isStringTree<Decay<T>>(), static_assert(!isStringTree<Decay<T>>(),
"When passing a StringTree into kj::strTree(), either pass it by rvalue " "When passing a StringTree into kj::strTree(), either pass it by rvalue "
...@@ -202,7 +202,7 @@ StringTree StringTree::concat(Params&&... params) { ...@@ -202,7 +202,7 @@ StringTree StringTree::concat(Params&&... params) {
template <typename... Params> template <typename... Params>
StringTree strTree(Params&&... params) { StringTree strTree(Params&&... params) {
return StringTree::concat(_::toStringTreeOrCharSequnece(kj::fwd<Params>(params))...); return StringTree::concat(_::toStringTreeOrCharSequence(kj::fwd<Params>(params))...);
} }
} // namespace kj } // namespace kj
......
...@@ -23,6 +23,7 @@ project's documentation for details. ...@@ -23,6 +23,7 @@ project's documentation for details.
* [C](https://github.com/jmckaskill/c-capnproto) by [@jmckaskill](https://github.com/jmckaskill) * [C](https://github.com/jmckaskill/c-capnproto) by [@jmckaskill](https://github.com/jmckaskill)
* [Go](https://github.com/glycerine/go-capnproto) by [@glycerine](https://github.com/glycerine) (originally by [@jmckaskill](https://github.com/jmckaskill)) * [Go](https://github.com/glycerine/go-capnproto) by [@glycerine](https://github.com/glycerine) (originally by [@jmckaskill](https://github.com/jmckaskill))
* [Java](https://github.com/dwrensha/capnproto-java/) by [@dwrensha](https://github.com/dwrensha)
* [Javascript](https://github.com/jscheid/capnproto-js) by [@jscheid](https://github.com/jscheid) * [Javascript](https://github.com/jscheid/capnproto-js) by [@jscheid](https://github.com/jscheid)
* [Lua](https://github.com/cloudflare/lua-capnproto) by [CloudFlare](http://www.cloudflare.com/) / [@calio](https://github.com/calio) * [Lua](https://github.com/cloudflare/lua-capnproto) by [CloudFlare](http://www.cloudflare.com/) / [@calio](https://github.com/calio)
* [OCaml](https://github.com/pelzlpj/capnp-ocaml) by [@pelzlpj](https://github.com/pelzlpj) * [OCaml](https://github.com/pelzlpj/capnp-ocaml) by [@pelzlpj](https://github.com/pelzlpj)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment