Skip to content

Walk hierarchy asynchronously #188

@radeksimko

Description

@radeksimko

Current Version

v0.4.0

Use-cases

Currently the whole hierarchy is walked through to discover root modules on initialization synchronously:

walker := rootmodule.NewWalker()
walker.SetLogger(lh.logger)
err = walker.WalkInitializedRootModules(fh.Dir(), func(dir string) error {
lh.logger.Printf("Adding root module (via %T): %s", rmm, dir)
return rmm.AddRootModule(dir)
})
if err != nil {
return serverCaps, err
}

This can result in:

  1. delay in adding paths to the watcher
  2. delayed initial response to the client, which means the client may refuse to provide any functionality until initialize request is responded to

Proposal

Run walker asynchronously.

It should still be cancellable per session though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions