Skip to content

cannot start from state :stopped (ArgumentError) #580

Open

Description

@AlexB52

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)

Activity

  1. ColinDKelley commented on Apr 16, 2024

    @ColinDKelley
    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
  2. deleted a comment from LouisaNikita on Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions