-
Notifications
You must be signed in to change notification settings - Fork 74
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
refactor(daemon): Synchronize makeGuest #2120
Conversation
// TODO: Return early if the formula identifier is the same. | ||
if (petNames.has(petName)) { | ||
// Perform cleanup on the overwritten pet name. | ||
const formulaPetNames = formulaIdentifiers.get(petName); | ||
if (formulaPetNames !== undefined) { | ||
formulaPetNames.delete(petName); | ||
} | ||
// TODO: Should this only happen if something is actually deleted? |
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 noticed these couple oddities in the pet store's write()
. I'll create an issue if we agree that there's something to do.
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.
@kriskowal thoughts on these?
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.
It would somewhat simplify client code if they are assured that they only see delete
messages for equal but opposite prior add
.
acaf382
to
45e718a
Compare
45e718a
to
14ae908
Compare
packages/daemon/src/async-hooks.js
Outdated
/** | ||
* @returns {import('./types.js').AsyncHooks<any>} | ||
*/ | ||
export const makeAsyncHooks = () => { |
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.
There’s a Node.js module by the same name that we don’t want to confuse this with. This is similar to a WaitGroup
in Go. I think DeferredSet
might be good.
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 went with deferredTasks
.
return { | ||
value: Promise.resolve(value), |
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.
Is the type system demanding we wrap these? Maybe we should use Awaited<T>
somewhere.
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.
yes
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.
The type system does demand this. Since this was already here, I'll leave it for now. Should we create an issue?
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.
Meh. Not big enough to track.
Synchronizes the daemon's incarnateGuest(). Replaces incarnateHandle() and incarnatePetStore() with their "incarnateNumbered" equivalents.
14ae908
to
f546680
Compare
Progresses: #2086
Synchronizes the host's
makeGuest()
and its dependencies. See #2086 for details.