-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
pkgs/_macro_host/lib/macro_host.dart
Outdated
final result = MacroHost._(queryService); | ||
final server = await MacroServer.serve(service: result); | ||
result._macroServer = server; |
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.
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.
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 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 :)
pkgs/_macro_host/lib/macro_host.dart
Outdated
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); |
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.
nit: just call this host
or something, it isn't really a "result" (there is no query or anything, its just a constructor call).
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.
Done.
f5c68da
to
36c62b0
Compare
36c62b0
to
e5139f6
Compare
No description provided.