Skip to content

Commit

Permalink
Merge pull request #706 from rails/synchronize
Browse files Browse the repository at this point in the history
Bring back `Spring::Watcher::Abstract#synchronize`
  • Loading branch information
byroot authored Nov 22, 2023
2 parents 8b285d5 + c1facc5 commit 029a265
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Next Release

* Bring back `Spring::Watcher::Abstract#synchronize` method to fix compatibility with `spring-watcher-listen`.

## 4.1.2

* Drop dependency on `mutex_m`. Avoid issues with loading the wrong version before bundler kicks in.
Expand Down
5 changes: 5 additions & 0 deletions lib/spring/watcher/abstract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ def initialize(root, latency)
@on_debug = nil
end

def synchronize(&block)
# Used by some gems.
@mutex.synchronize(&block)
end

def on_debug(&block)
@on_debug = block
end
Expand Down

0 comments on commit 029a265

Please sign in to comment.