Repository navigation
refactor: document gRPC startup and web composition flows - #62
Merged
Merged
Conversation
Move the publisher and subscriber setup out of the application builder into the sword-events crate. The builder now creates an event runtime and starts it once the DI container is built. Also extract the built-in layer registration into a helper method and drop the watch shutdown channel from the Application instance.
Translate the recently added comments from spanish to english and fix some of them to match the real code: the ApplicationEngine enum is now documented per variant and the builder diagram describes how the State is used by the container, controllers, interceptors and layers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Sword gRPC
GrpcApplication::fromnow takes only gRPC controllers viaControllerRegistry::get_by_kindinto acontroller_ids: HashSet<TypeId>, instead of snapshotting the wholeControllerMap. The empty-controller guard was simplified tois_empty().HashMap<TypeId, GrpcControllerRegistrar>and looked up per controller.build_reflection_service; the reflection service now actually mounts (previously theadd_serviceresult was discarded) and the#[cfg]assignment compiles.start()explaining the non-obvious ordering and short rustdoc (with examples) onGrpcControllerRegistrarand itsbuild/registerclosures.Sword Web
controller_id, controller build before route handling, merge vs. nest per path, mandatory layer order, cookie/user/NotFound layering, andstart()state attachment and graceful shutdown.Why
The discovery/registration flow is macro-generated, so the real behavior wasn't visible in the source. These comments record the contracts (build-before-register, mapping, layering order) for maintainers.
Fromno longer copies the whole controller map, and the reflection wiring was both broken to compile and silently dropped the service — now fixed.