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

In-LDM event squashing (instead of an output buffer) #8

Open
KB1RD opened this issue Jan 8, 2021 · 1 comment
Open

In-LDM event squashing (instead of an output buffer) #8

KB1RD opened this issue Jan 8, 2021 · 1 comment
Assignees
Labels
blocked Blocked on something else enhancement New feature or request

Comments

@KB1RD
Copy link
Member

KB1RD commented Jan 8, 2021

In my various implementations using the LDM, I often hold events that cannot be sent immediately (in the case of Matrix, this is due to sending limits) in an output buffer. When consecutive operations are sitting in the buffer waiting to be sent, they are merged together if possible to reduce the number of events sent.

However, this requires an algorithm to merge nodes together and as I started improving it, it began to look more and more like the LDM itself. In that case, why not just grab the nodes right out of the LDM itself? The insertion and removal methods could be modified to additionally return an object specifying the relevant region of nodes where the insertions/removals originated from. When the events being sent end up stuck in a queue, these regions only are merged together if possible. Then, the LDM is asked for the insertions/removals in that region. This effectively offloads squashing to the LDM and potentially opens up an opportunity to share the current state of the document with other peers.

@KB1RD KB1RD added the enhancement New feature or request label Jan 8, 2021
@KB1RD KB1RD self-assigned this Jan 8, 2021
@KB1RD
Copy link
Member Author

KB1RD commented Jan 8, 2021

This would require at least a partial implementation of #4

@KB1RD KB1RD added the blocked Blocked on something else label Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on something else enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant