ron icon indicating copy to clipboard operation
ron copied to clipboard

Frame header format

Open gritzko opened this issue 7 years ago • 11 comments

Needs specification, esp event/ref uuids

например, может быть header без содержимого, если, скажем, query просит последние изменения, а их нет, всё так же метаданные - event id и ref id, которые задают интервал event id, входящих во фрейм ref id == 0 значит, что это полное состояние event id = 0 значит, что это пустое состояние

gritzko avatar Jul 19 '18 18:07 gritzko

What is a header? Is it mandatory? Must there be exactly 1 header?

cblp avatar Jul 23 '18 16:07 cblp

A reducer's output is always a frame that MUST start with a header. A reducer MAY produce several headers thus delimiting chunks of output. A general frame may contain a mix of raw ops and reducer outputs, thus it can contain any number of headers (may have none if empty or all-raw).

gritzko avatar Jul 23 '18 16:07 gritzko

Consider frame containing reducer output and then some raw ops. What does it look like in the text format? Are there any means to signal an end of the frame or start another chunk in the text format?

cblp avatar Jul 23 '18 16:07 cblp

*lww #obj @time1+origin !
    :one =1 ,
    :two 'два' ,

@time2+origin :three ^3.0 ;

.

(lww reducer output plus one yet-unreduced op)

gritzko avatar Jul 23 '18 17:07 gritzko

  • another chunk starts with another header;
  • a raw op does not belong to any output, hence any chunk;
  • a frame is explicitly finalised with a period . (required for separating frames in a byte stream, otherwise optional)

gritzko avatar Jul 23 '18 17:07 gritzko

I'm sorry, but in example above I don't see how "another chunk starts with another header".

Also comma and semicolon seem not documented. What do they mean?

cblp avatar Jul 23 '18 17:07 cblp

Also, the document states header is an op, but this header isn't, it has no location.

cblp avatar Jul 23 '18 17:07 cblp

Also comma and semicolon seem not documented. What do they mean?

Oops. Comma terminates reduced ops, semicolon terminates raw ops. Comma is optional.

gritzko avatar Jul 24 '18 09:07 gritzko

another chunk starts with another header;

Let's reword this: a chunk consists of a header ! or a query header ? op followed by reduced , ops belonging to the chunk. Raw ops form their own one-op chunk.

gritzko avatar Jul 24 '18 09:07 gritzko

Also, the document states header is an op, but this header isn't, it has no location.

Omitted UUID is set to the default value, which is the same UUID of the previous op. For the first op, the default is 0. e.g. see https://github.com/gritzko/ron-test/blob/master/05-rga.in.ron#L38

gritzko avatar Jul 24 '18 09:07 gritzko

I'll remove that zero default UUID. Indeed, it adds confusion but makes no huge savings. e.g. *lww #object @version ! or *lww #object @version :0 !

gritzko avatar Jul 24 '18 09:07 gritzko