19686: api constructor returns ThreadSafeApiCache
authorBrett Smith <brett.smith@curii.com>
Tue, 29 Nov 2022 20:01:43 +0000 (15:01 -0500)
committerBrett Smith <brett.smith@curii.com>
Thu, 8 Dec 2022 15:27:59 +0000 (10:27 -0500)
commit2668643b7570db96651466250e7a496184f6ef0a
treeb912a42ab1b2b14b1274013ece49b25c930bd76d
parentadcef9f939b663d88a12d5d3597c3b0184d2579f
19686: api constructor returns ThreadSafeApiCache

This is an API-compatible wrapper object that provides thread
safety. Returning this from api() helps keep users out of
trouble.

The changes to ThreadSafeApiCache are required to keep it API-compatible
with the original and keep tests passing. Assignments to the request_id
attribute need to be used for all future requests. It's a little unclear
if this is an intended API or just test scaffolding, but it's not too
difficult to keep working so I just did that.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>
sdk/python/arvados/api.py
sdk/python/arvados/safeapi.py
sdk/python/tests/test_api.py