waikato-ufdl / ufdl-python-client

Core Python library for accessing the UFDL backend, managing the communication.
Apache License 2.0
0 stars 0 forks source link

Retrying streamed data transmission #3

Open csterling opened 4 years ago

csterling commented 4 years ago

The client automatically handles refreshing and retrying requests which fail due to expired JWT tokens. This is achieved by attaching the same object to the retry request as was attached to the original (usually a JSON object, which is fine). However for file uploads the attached data may be a stream of bytes, which may be partly consumed by the original request.

Handle this case, possibly by buffering the part of the stream that is already consumed during the first transmission so it can be retransmitted on failure.