Hi John,
Upon further reflection, I would like to make sure I have things
right. I'm trying to determine what, exactly, is the output of the
transformer? I think I know, but I want to make sure. For example,
let's say we have two op streams, streamA and streamB, such that
streamA = A1, A2, A3
streamB = B1, B2, B3
In my understanding, the output of transform(streamA, streamB) would
be
streamA' = A1, B1', A2, B2', A3, B3'
streamB' = B1, A1', B2, A2', B3, A3'
Is that correct? If so, I'm a little confused about how the clients
deal with this. For example, client A has applied A1, A2 and A3, and
gets back streamA' from the server (right?). But it can't just apply
B1-3', can it? I haven't worked it out, but I don't believe that that
would work. Does client A hold off on "committing" its changes to its
own content until it gets the up-to-date version from the server
(whether compressed by the Composer or not)?
Thanks,
Turner
On Jan 31, 9:07 pm, John Barstow <[email protected]> wrote:
> On Mon, Feb 1, 2010 at 1:46 PM, Turner <[email protected]> wrote:
>
> > But what are A' and B'? How are they different? It might be helpful
> > for me to work on an example. Let's say the server is trying to apply
> > the following operations to a document with content ABCD:
>
> > A: insert(1, "CD") (insert "CD" at position 1)
> > B: delete(2, 1) (delete 1 character starting from position 2)
>
> > Once the transformer has done its thing, it seems to me that A' should
> > be something like {insert(1, "CD"); delete(4, 1)}, and B' should be
> > the same. Or am I combining the work of the Transformer and Composer
> > together? Would A' = A = insert(1, "CD") and B' = delete(4,1), and the
> > composer then slap them together in the right order? I feel like I'm
> > probably missing something here.
>
> Your second interpretation is correct.
>
> A' - insert(1, "CD") <-- this could originally be two individual
> inserts composed into a single one by the client.
> B' - delete(4, 1)
>
> What this looks like on the server:
> v1 = ABCD
> v2 = v1 + A (or v1 + B if applied first)
> v3 = v2 + B' (or v2 + A' if B applied first)
>
> On client A:
> v2 = v1 + A (sends A to server)
> v3 = v2 + B' (gets B' as part of reply)
>
> On client B:
> v2 = v1 + B (sends B to server)
> v3 = v2 + A' (gets A' as part of reply)
>
> On client C:
> no edits; just asks for updates since v1
> v2 = v1 + [A,B'] <-- here's an example where the Composer might be
> applied, to reduce the number of operations sent to the client
> (or, if B was applied first by the server, v1 + [B,A'] )
>
> This is obviously a simplification. The server actually tracks the
> version number, and "last known version" is always part of the delta.
>
> Hopefully this makes things clearer.
--
You received this message because you are subscribed to the Google Groups "Wave
Protocol" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/wave-protocol?hl=en.