This PR adds the ability to track pending requests. A request is determined as pending when one of the assets is currently in process of being retrieved from the exchanges.
For example, the XRC receives a request X for ICP/BTC at timestamp 100. While the XRC starts processing request X, another request (Y) for BTC/USDT at timestamp 100 is received. The XRC canister adds the following symbol-timestamp pairs to the tracking set from request X:
("ICP", 100) and ("BTC", 100).
While waiting for request X's results, the XRC begins to process request Y. As request Y contains the symbol-timestamp pair ("BTC", 100), request Y is determined to be pending and the Pending error is returned to the user.
This PR adds the ability to track pending requests. A request is determined as
pending
when one of the assets is currently in process of being retrieved from the exchanges.For example, the XRC receives a request
X
forICP/BTC
at timestamp100
. While the XRC starts processing requestX
, another request (Y
) forBTC/USDT
at timestamp100
is received. The XRC canister adds the following symbol-timestamp pairs to the tracking set from requestX
:("ICP", 100)
and("BTC", 100)
.While waiting for request
X
's results, the XRC begins to process requestY
. As requestY
contains the symbol-timestamp pair("BTC", 100)
, requestY
is determined to bepending
and thePending
error is returned to the user.