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

Introduce Defer to module loader #590

Merged
merged 1 commit into from
Jul 22, 2021
Merged

Introduce Defer to module loader #590

merged 1 commit into from
Jul 22, 2021

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Jul 22, 2021

@Nepomuceno Do you think this would help in #551 ?

I guess the Enqueue method could return the operation and make the caller do the actual queueing and potentially setting Defer function instead of passing it as argument, but that's mostly a stylistic concern that can be refactored later.

If this helps solving the problem I'd ship it. 🤷🏻‍♂️

@radeksimko radeksimko added the enhancement New feature or request label Jul 22, 2021
@radeksimko
Copy link
Member Author

radeksimko commented Jul 22, 2021

The idea is that you'd modify the following line(s) in the watcher and walker:

w.modMgr.EnqueueModuleOp(mod.Path, op.OpTypeParseModuleManifest, nil)

to async enqueue all the other relevant/dependent operations, e.g.

w.modMgr.EnqueueModuleOp(mod.Path, op.OpTypeParseModuleManifest, func(opErr error) {
    if opErr != nil {
        return
    }
    // TODO: range over module calls to get modPath for each
    w.modMgr.EnqueueModuleOp(modPath, op.OpTypeParseModuleConfiguration, nil)
    w.modMgr.EnqueueModuleOp(modPath, op.OpTypeParseVariables, nil)
    w.modMgr.EnqueueModuleOp(modPath, op.OpTypeLoadModuleMetadata, nil)
    w.modMgr.EnqueueModuleOp(modPath, op.OpTypeDecodeReferenceTargets, nil)
    w.modMgr.EnqueueModuleOp(modPath, op.OpTypeDecodeReferenceOrigins, nil)
})

@radeksimko radeksimko merged commit 795a256 into main Jul 22, 2021
@radeksimko radeksimko deleted the f-mod-ops-defer branch July 22, 2021 15:16
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant