Converting a Ruby block interface to start/stop methods with a Fiber
Summary
This article examines converting a Ruby block interface into explicit start and stop methods using a Fiber, contrasting Fiber-based control with a thread-based approach. It provides practical code examples comparing a ThreadedResourceWrapper and a FiberResourceWrapper, and discusses trade-offs like resource sharing, lifecycle management, and readability. The piece ties the technique to real-world usage in Playwright-Ruby-Client and suggests ideas for integrating such patterns into RSpec workflows.