mockers icon indicating copy to clipboard operation
mockers copied to clipboard

Thread-safe mocks

Open bossmc opened this issue 7 years ago • 0 comments

Currently the generated mock objects all share access to the internals, though an Rc<RefCell<Internals>> so aren't Sync or Send. It also seems (from a cursory effort to change that to Arc<Mutex<...>>) that various of the Matcher/Expectation/Call objects/traits aren't (guaranteed) thread-safe.

With futures/tokio becoming all the rage, it would be really useful to be able to generate mocks that can be passed through future chains, but this requires Send/Sync.

bossmc avatar Jan 30 '18 19:01 bossmc