Skip to content
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

cannot start from state :stopped (ArgumentError) #580

Open
AlexB52 opened this issue Mar 10, 2024 · 1 comment
Open

cannot start from state :stopped (ArgumentError) #580

AlexB52 opened this issue Mar 10, 2024 · 1 comment

Comments

@AlexB52
Copy link
Contributor

AlexB52 commented Mar 10, 2024

This is more of a question than an issue

What are the reasons preventing the listener's interface to restart after a stop?

require "listen"
listener = Listen.to { |changes| puts changes }
listener.start
listener.stop
listener.start
# => cannot start from state :stopped (ArgumentError)
@ColinDKelley
Copy link
Collaborator

@AlexB52 I'm guessing there was concern about cleaning up state for reuse like that. Isn't it equally easy to create a new listener?

require "listen"
listener1 = Listen.to { |changes| puts changes }
listener1.start
listener1.stop

listener2 = Listen.to { |changes| puts changes }
listener2.start

@guard guard deleted a comment from LouisaNikita Apr 16, 2024
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

No branches or pull requests

2 participants