Hi Qibin,

Cap'n Proto supports random access within a message. One way you could do
what you want is to create your file as a single large message containing a
List, instead of multiple messages.

If you need to use multiple messages (say, because you write them in a
streaming way), then it's up to you to create some sort of index that
allows you to seek to a particular message in constant time. Cap'n Proto
itself doesn't define any such indexing mechanism.

-Kenton

On Fri, Feb 21, 2020 at 9:52 PM Qibin Zhou <[email protected]> wrote:

> Hi,
>
> I want to create a multi-message file and randomly access individual
> messages in python. Is there any way to do it in pycapnp? Thank you very
> much!
>
> Best,
>
> Qibin
>
>
> *Disclaimer*
>
> The information contained in this communication from the sender is
> confidential. It is intended solely for use by the recipient and others
> authorized to receive it. If you are not the recipient, you should delete
> this message. You are hereby notified that any disclosure, copying,
> distribution or taking action in relation to the contents of this
> information is strictly prohibited and may be unlawful.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Cap'n Proto" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/capnproto/bee76a9f-0bb5-4f92-84e8-cd598c8a7bed%40googlegroups.com
> <https://groups.google.com/d/msgid/capnproto/bee76a9f-0bb5-4f92-84e8-cd598c8a7bed%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQnmNMzpxALfTraC8yV9o9U%3D9HVh7QK78Zx7yYYqZ%2B67ww%40mail.gmail.com.

Reply via email to