[Chicago] Braintree Environment, Configuration, and Thread Safety

Mark Graves mgraves87 at gmail.com
Sun Jul 17 10:11:12 EDT 2016


Thanks Adam!

-Mark

On Sun, Jul 17, 2016 at 8:56 AM, Adam Forsyth <adam at adamforsyth.net> wrote:

> Yep, it's safe.
>
> You even can switch environments / configs etc. by instantiating a
> configuration object and gateway, and then using that instead of the static
> methods. I know Ray (another ChiPy member who works at Braintree) has
> example code for that, and I'll make sure he sends it out on Monday if he
> doesn't see this thread by then -- even though it sounds like you don't
> need it.
>
> Adam
>
> On Sun, Jul 17, 2016 at 8:47 AM, Mark Graves <mgraves87 at gmail.com> wrote:
>
>> Hey everyone,
>>
>> Does anyone know if it is safe to put Braintree python client code into a
>> module from a thread safety perspective for a web app?  Or any other
>> caveats?
>>
>> I'm not switching environments or anything mid request, just trying to
>> clean up some code.
>>
>> I'm trying to refactor a web app which has some boilerplate code in the
>> models and controllers, and I wanted to move this into a module.
>>
>> I wasn't sure if it does some internal session handling etc, which might
>> conflict if imported, but would not if run per request.
>>
>> I've looked through the source on
>> https://github.com/braintree/braintree_python
>>
>> which looks like most of the calls I make are static methods, but I was
>> looking for any gotchas.
>>
>> Thanks!
>>
>> -Mark
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> https://mail.python.org/mailman/listinfo/chicago
>>
>>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20160717/a1b08bd6/attachment.html>


More information about the Chicago mailing list