Skip to content

Comments

feat: add launch_with_fn#8694

Merged
mattsse merged 1 commit intomainfrom
matt/add-launch-with-fn
Jun 10, 2024
Merged

feat: add launch_with_fn#8694
mattsse merged 1 commit intomainfrom
matt/add-launch-with-fn

Conversation

@mattsse
Copy link
Collaborator

@mattsse mattsse commented Jun 8, 2024

provides a way to use closure launchers and implement LaunchNode for closures

@mattsse mattsse requested review from Rjected and onbjerg as code owners June 8, 2024 09:42
@mattsse mattsse added C-enhancement New feature or request A-sdk Related to reth's use as a library labels Jun 8, 2024
}

/// Launches the node with the given closure.
pub fn launch_with_fn<L, R>(self, launcher: L) -> R
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is the difference between this and launch_with(closure) given closures now impl LaunchNode?

Copy link
Collaborator Author

@mattsse mattsse Jun 10, 2024

Choose a reason for hiding this comment

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

this supports arbitrary logic and supports launch functions as closures and helps with type hints, otherwise the user would need to provide type hints explicitly on launch_node

@mattsse mattsse added this pull request to the merge queue Jun 10, 2024
Merged via the queue into main with commit 53f4eca Jun 10, 2024
@mattsse mattsse deleted the matt/add-launch-with-fn branch June 10, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-sdk Related to reth's use as a library C-enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants