cleanup(turbopack): Embed Global vs Specific channel type in the Rust type system (#79291)
## Refactor CompilationEventQueue to use enum for event channel types
### What?
Introduces a new `EventChannelType` enum to replace string-based event
channel identification in the `CompilationEventQueue`.
### Why?
This change improves type safety by replacing string-based channel
identification with a proper enum. Using an enum instead of string
literals makes the code more robust and more self-evident in what it's
trying to accomplish.
### How?
- Created a new `EventChannelType` enum with two variants: `Global` and
`Type(String)`
- Updated the `subscribers` map to use `EventChannelType` as keys
instead of strings
- Replaced string literals like `"*"` with the appropriate enum variant
(`EventChannelType::Global`)
- Modified the event subscription and publishing logic to work with the
new enum-based approach
---------
Co-authored-by:
Tobias Koppers <tobias.koppers@googlemail.com>
Showing
Please
register
or
sign in
to comment