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

Differentiate types of request explicitly, remove ListOfService. #27

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

davidmorgan
Copy link
Contributor

No description provided.

Comment on lines 31 to 33
final result = MacroHost._(queryService);
final server = await MacroServer.serve(service: result);
result._macroServer = server;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely still sending up red flags for me, assigning manually fields like this after construction is something I would always try to avoid. I get that the cyclic dependency sort of requires it here, but I would still like to see that cycle broken.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The circle is due to the class doing too much: it's the host and the host service.

Split out the host service and now it looks much better, thanks :)

return MacroHost._(server, listOfServices);
/// Starts a macro host with introspection queries handled by [queryService].
static Future<MacroHost> serve({required QueryService queryService}) async {
final result = MacroHost._(queryService);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: just call this host or something, it isn't really a "result" (there is no query or anything, its just a constructor call).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@davidmorgan davidmorgan merged commit e48bef4 into dart-lang:main Aug 8, 2024
39 checks passed
@davidmorgan davidmorgan deleted the remove-list-of-service branch August 8, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants