Closed Milly closed 2 months ago
[!IMPORTANT]
Review skipped
Auto reviews are disabled on base/target branches other than the default branch.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
These changes revise the Service
class to implement AsyncDisposable
instead of Disposable
, introducing new async closure functionalities and states. Test cases are updated to reflect these changes, focusing on service closure and promise handling. Additionally, modifications in the worker demonstrate how services now handle async disposal.
Files | Change Summaries |
---|---|
denops/@denops-private/service.ts | Updated Service class to implement AsyncDisposable , added #closed flag and associated methods (close , waitClosed ). |
denops/@denops-private/service_test.ts | Removed outdated test case for reload() , added tests for new closure and promise handling methods in Service . |
denops/@denops-private/worker.ts | Added await for service initialization and included service.waitClosed() in control flow. |
denops/@denops-private/worker_test.ts | Added new imports, spies, and test validations for async disposal of services and hosts. |
sequenceDiagram
participant Host
participant Service
participant Worker
Note over Worker,Service: Service initialization with async disposal
Worker->>+Service: new Service(meta) (await initialization)
Worker->>Service: Promise.race([... , service.waitClosed()])
Host->>Worker: Trigger event
Worker->>Service: Close service (trigger close())
Note over Service: Service closure sequence
Service->>Worker: Resolve waitClosed()
Worker->>Host: Resolve Promise.race()
In code's vast fields, new paths unfold, Async closures, stories told. Service waits in silent grace, Until the end, it holds its place. Tests arise, new dawn’s light, With closure’s promise, futures bright. 🌟✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.53%. Comparing base (
6155f40
) to head (cf2473f
).:exclamation: Current head cf2473f differs from pull request most recent head 1f861cf
Please upload reports for the commit 1f861cf to get more accurate results.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@coderabbitai review
denops.dispatch()
(butservice.dispatch()
) rejects with a service closed error if the service is closed before the plugin loaded.Summary by CodeRabbit
New Features
Service
class with new asynchronous disposal capabilities.Tests
close()
andwaitClosed()
methods.Bug Fixes