Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame header format #26

Open
gritzko opened this issue Jul 19, 2018 · 11 comments
Open

Frame header format #26

gritzko opened this issue Jul 19, 2018 · 11 comments

Comments

@gritzko
Copy link
Owner

gritzko commented Jul 19, 2018

Needs specification, esp event/ref uuids

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

@cblp
Copy link
Collaborator

cblp commented Jul 23, 2018

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

@gritzko
Copy link
Owner Author

gritzko commented Jul 23, 2018

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).

@cblp
Copy link
Collaborator

cblp commented Jul 23, 2018

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?

@gritzko
Copy link
Owner Author

gritzko commented Jul 23, 2018

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

@time2+origin :three ^3.0 ;

.

(lww reducer output plus one yet-unreduced op)

@gritzko
Copy link
Owner Author

gritzko commented Jul 23, 2018

  • 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)

@cblp
Copy link
Collaborator

cblp commented Jul 23, 2018

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
Copy link
Collaborator

cblp commented Jul 23, 2018

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

@gritzko
Copy link
Owner Author

gritzko commented Jul 24, 2018

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

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

@gritzko
Copy link
Owner Author

gritzko commented Jul 24, 2018

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
Copy link
Owner Author

gritzko commented Jul 24, 2018

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:/gritzko/ron-test/blob/master/05-rga.in.ron#L38

@gritzko
Copy link
Owner Author

gritzko commented Jul 24, 2018

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants