Questions tagged [capnproto]

Cap'n Proto is a zero-copy data interchange format described by a schema language not unlike Protobuf, and an associated capability-based RPC system.

Cap'n Proto is a zero-copy serialization format described by a schema language not unlike Protobuf and an associated capability-based RPC system.

99 questions
1
vote
1 answer

identifying caller in capnproto RPC

I am implementing a service in CapnProto. The service follows these steps (roughly): authenticate on the server do operations through a Service interface (object-capability) once authenticated. I want to achieve something like the…
Germán Diago
  • 7,473
  • 1
  • 36
  • 59
1
vote
2 answers

How to instantiate a generic Cap'n Proto type in pycapnp

I cannot figure out how to instantiate an Option(T) type in pycapnp. I have tried to instantiate a new message and then set the value of 'some', but it loses type information in doing so. struct Option(T) { union { none @0 :Void; some @1…
Dan Jenson
  • 961
  • 7
  • 20
1
vote
1 answer

How to set the Cap'n Proto RPC message traversal limit?

I need to send an RPC with the Rust Cap'n Proto API that exceeds the default message traversal limit. When I try to send the message, I get the following error: remote exception: :capnp/arena.c++:130: failed:…
pdiffley
  • 603
  • 9
  • 18
1
vote
0 answers

Getting EOF while reading data using cap'n'proto

Steps: func viewAll(db *badger.DB) { txn := db.NewTransaction(false) defer txn.Discard() iterOpts := badger.IteratorOptions{false, 0, false, true} itr := txn.NewIterator(iterOpts) defer itr.Close() b :=…
Vadim Filin
  • 342
  • 3
  • 12
1
vote
1 answer

Implementing a client connection function that waits for the server in capnproto

I'm trying to implement in capnproto something like boost's connect function which blocks and retries until the server is up, or basic_socket::async_connect that lets me implement a callback with which to try connecting once more. For example,…
ytm
  • 461
  • 1
  • 5
  • 16
1
vote
1 answer

Fill CapnProto List with non-primitive

According to the CapnProto documentation: (NOTE: I am using the C++ version) For List where Foo is a non-primitive type, the type returned by operator[] and iterator::operator*() is Foo::Reader (for List::Reader) or Foo::Builder (for…
user_48349383
  • 517
  • 6
  • 13
1
vote
1 answer

Outputting pyspark dataframe in capnp (cap'n proto) format

I have been tasked with outputting a Pyspark Dataframe into cap'n proto (.capnp) format. Does anyone have a suggestion for the best way to do this? I have a capnp schema, and I have seen the python wrapper for capnp…
Eka
  • 31
  • 1
  • 5
1
vote
0 answers

capnproto : Can I get an AnyPointer from a struct?

Given this schema struct TestObject { value1 @0 : Int32 = -5; value2 @1 : Float32 = 9.4; } struct TestContainer { object @0: TestObject; } Is it possible to get an AnyPointer::Builder from the TestObject::Builder in c++ code? This is…
David Woo
  • 749
  • 4
  • 13
1
vote
0 answers

Multi-threaded Cap'n Proto Python (pycapnp) RPC server

I'm writing a simple RPC server in Python 3 using pycapnp. I have a single function call that takes roughly a second to complete. This function also needs data stored in a cache (currently implemented using lru-dict). Everything works fine with a…
Anto
  • 11
  • 1
1
vote
1 answer

Cap'n Proto and promise pipelining

I would like to try promise pipelining with Cap'n Proto C++ RPC but I don't know how to do it. Here is my schema : interface Test { getInt @0 () -> (intResult :Int32); increment @1 (intParam :Int32) -> (intResult :Int32); } Here is what I would…
B. Clement
  • 298
  • 2
  • 13
1
vote
1 answer

Proper syntax to read and write byte array in Cap'n Proto?

Let's say I have an array: struct UUID { char data[16]; }; And I have it like so in the schema: struct UUID { value @0 : Data; } What's the proper way to read and write this field? It looks like I should be able to wrap a…
Jason Maskell
  • 1,716
  • 1
  • 17
  • 26
1
vote
1 answer

Are there any Thrift-style RPC systems that allow callbacks?

After using several different messaging and RPC systems I have come to the conclusion that you eventually always need traditional RPC, and push events of some kind. Otherwise you inevitably end up with some polling hack. For example, HTTP originally…
Timmmm
  • 88,195
  • 71
  • 364
  • 509
1
vote
1 answer

How to get byte[] into capnp::Data

On the official website, there is a nice and relatively comprehensive example of how one could use CapnProto for C++ serialisation. What is missing, is how to handle the second Blob type capnp::Data, as only capnp::Text is covered. Just for…
Dave
  • 1,784
  • 2
  • 23
  • 35
1
vote
0 answers

Corrupted network write in kj AsyncIoStream

I'm implementing an networked application on the excellent kj-async library from Cap'n Proto. The example code below serves a (large, preloaded) file (argv[1]) over TCP. If I redirect it directly to a file with nc localhost 9004 > test, the file is…
1
vote
2 answers

Wire protocol buffers vs Cap'n proto - which one is better?

I'm currently using wire protocol buffers in one of my android apps and looks like it's parseFrom() method is not very efficient as it takes ~10 ms even to parse a very small amount of data. So I came across this:…
pree
  • 2,297
  • 6
  • 37
  • 55