-
Notifications
You must be signed in to change notification settings - Fork 535
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
Move drivers to streaming API for op retrieval #5703
Conversation
…switch to async iterator in the future
to: number | undefined, | ||
abortSignal?: AbortSignal, | ||
cachedOnly?: boolean, | ||
): IStream<ISequencedDocumentMessage[]>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be make this an "async iterator" since they are so similar already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it. Maybe. I have a feeling that it will be useful to be able to query it for more things. Like, have progress reporting (i.e. how many ops are still there, if that can be answered). Maybe we can have it both?
I do not have strong opinion here, happy to convert to async iterator.
The part that worries me is red X next to Safari on iOS:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator
Can't find equivalent, but I had to back out code earlier due to usage of async generators due to compat concerns, so I'm a bit hesitant to jump here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done manual test on iOS and async iterator is working fine for me, being on latest iOS.
That said, https://caniuse.com/?search=async%20iterator also is in red. So I'm not sure.
I'm thinking of leaving it as is for now (though ask around), until it becomes green across the board (yes, future changes would require back compat, but it's not such a big deal imho). Let me know what you think
…to FetchOpsDriver # Conflicts: # packages/drivers/odsp-driver/src/contracts.ts # packages/drivers/odsp-driver/src/odspDeltaStorageService.ts # packages/drivers/odsp-driver/src/odspDocumentService.ts
Ping. I'd love to move forward with it. |
@@ -24,7 +24,7 @@ import winston from "winston"; | |||
import { IAlfredTenant } from "@fluidframework/server-services-client"; | |||
import { Constants } from "../../../utils"; | |||
|
|||
export async function getDeltas( | |||
async function getDeltas( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the server changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. we'll just need to pay attention to rollout, as this breaks driver/loader contracts which could cause problems with dynamic drivers once that lands
…to FetchOpsDriver # Conflicts: # packages/test/test-drivers/src/odspDriverApi.ts # packages/test/test-end-to-end-tests/src/test/contextReload.spec.ts
⯆ @fluidframework/base-host: -4.59 KB
⯅ @fluid-example/bundle-size-tests: +5.24 KB
Baseline commit: 6555aa8 |
Hide the logic on how driver fetches ops behind streaming API.
That ensures that driver controls such aspects as
As part of redesign, start introducing AbortSignal on all of our network APIs.
This allows caller to cancel complex operations. In future that would likely need to change as well to include more scenarios (including progress reporting, prioritization, etc.).
Also exposing cachedOnly flag on request for loader to have ability (future PRs) to request cached ops (cached in snapshot and cached on local machine) to be able to rehydrate container to more recent state without waiting for network call to come back. This will ensure we could address gaps in user experience.
Making [from, to) arguments to be inclusive on left side and exclusive on right side - much easier to think and do math (things like calculate length, next batch, etc.)
Expose overrides in ODSP driver, such that fetch tool can continue to be more aggressive (currently - batches of 20K in size and 4 concurrent requests).
Areas of most feedback I'd love to get - naming :)
Unrelated (sort of) changes: