3 ms·
For starters, phoenix has had "support" for the equivalent of fiber-safe database connection pools forever, and it's advanced enough that you can concurrently r
by dnautics 5y ago
For starters, phoenix has had "support" for the equivalent of fiber-safe database connection pools forever, and it's advanced enough that you can concurrently run tests that checkout database "sandbox" transactions and you can spawn a task off it "that runs in another fiber" which will still know which database sandbox to use and with about 10LOC you can make it so your integration test can issue an http request to the server and the "fiber" that handles the request operates in the same sandbox. Oh, and this pattern is part of the standard library so it will work with just about any other thing that needs to share global state (like mocks), not just databases.