-
Notifications
You must be signed in to change notification settings - Fork 553
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do better bookkeeping when tracking state in
Thread.current
This is largely just another cleanup patch, but does a couple main things: * Hoists the `last_response` value into thread state. This is a very minor nicety, but effectively makes `StripeClient` fully thread-safe, which seems like a minor nicety. Two calls to `#request` to the same `StripeObject` can now be executed on two different threads and their results won't interfere with each other. * Moves state off one-off `Thread.current` keys and into a single one for the whole client which stores a new simple type of record called `ThreadContext`. Again, this doesn't change much, but adds some minor type safety and lets us document each field we expect to have in a thread's context.
- Loading branch information
Showing
2 changed files
with
170 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters