Skip to content

refactor: update event handling to use ComfyEvent and ConnectionEvent#23

Merged
jmjoy merged 3 commits intomasterfrom
jmjoy/develop
Apr 19, 2025
Merged

refactor: update event handling to use ComfyEvent and ConnectionEvent#23
jmjoy merged 3 commits intomasterfrom
jmjoy/develop

Conversation

@jmjoy
Copy link
Owner

@jmjoy jmjoy commented Apr 19, 2025

No description provided.

@jmjoy jmjoy requested a review from Copilot April 19, 2025 04:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors event handling to leverage the new ComfyEvent and ConnectionEvent abstractions, removing the legacy ExecutedOutput and OtherEvent variants.

  • Updated import paths and pattern matching to reflect the new event types
  • Refactored tests, client event stream processing, and example code accordingly

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/integration.rs Updated event pattern matching in integration tests
src/meta.rs Refactored event enums and executed output structure
src/lib.rs Adjusted event stream handling to use new event types
examples/text_to_image.rs Updated matching on event variants in example usage
Comments suppressed due to low confidence (2)

examples/text_to_image.rs:193

  • [nitpick] The warning message for unknown events currently logs a generic message. Consider including additional context—such as the expected event types—to improve debugging clarity.
ComfyEvent::Unknown(event) => {

src/lib.rs:526

  • The fallback logic now wraps deserialization errors as ComfyEvent::Unknown. Ensure that all downstream consumers of Event are updated to handle this new variant appropriately.
match serde_json::from_value::<ComfyEvent>(value.clone()) {

@jmjoy jmjoy merged commit fe73d9e into master Apr 19, 2025
1 check passed
@jmjoy jmjoy deleted the jmjoy/develop branch April 19, 2025 04:33
@github-actions github-actions bot mentioned this pull request Apr 19, 2025
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.

1 participant