Added Pursuit functionality (Untested and not fully implemented) + Global TrackedRequestSending check
This commit is contained in:
@ -90,6 +90,38 @@ FGuid UDTFluxQueuedManager::QueueRequest(EDTFluxRequestType RequestType, int32 C
|
||||
return NewRequest.RequestId;
|
||||
}
|
||||
|
||||
bool UDTFluxQueuedManager::MarkRequestAsError(const FGuid& TargetRequestGuid)
|
||||
{
|
||||
// TODO: Implement a retry mechanism
|
||||
// For now we simply suppress the request and log a message
|
||||
bool bFoundMatch = false;
|
||||
FDTFluxQueuedRequest Request;
|
||||
TQueue<FDTFluxQueuedRequest, EQueueMode::Mpsc> TempQueue;
|
||||
while (PendingRequestsQueue.Dequeue(Request))
|
||||
{
|
||||
if (Request.RequestId == TargetRequestGuid)
|
||||
{
|
||||
UE_LOG(logDTFluxNetwork, Error,
|
||||
TEXT("Marked request %s as error: Type=%d, ContestId=%d, StageId=%d, SplitId=%d"),
|
||||
*Request.RequestId.ToString(), (int32)Request.RequestType, Request.ContestId, Request.StageId,
|
||||
Request.SplitId);
|
||||
}
|
||||
else
|
||||
{
|
||||
TempQueue.Enqueue(Request);
|
||||
}
|
||||
}
|
||||
while (TempQueue.Dequeue(Request))
|
||||
{
|
||||
PendingRequestsQueue.Enqueue(Request);
|
||||
}
|
||||
if (bFoundMatch)
|
||||
{
|
||||
UE_LOG(logDTFluxNetwork, Error, TEXT("No Request Found with GUID %s"), *TargetRequestGuid.ToString());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UDTFluxQueuedManager::MarkRequestAsResponded(const FGuid& TargetRequestGuid)
|
||||
{
|
||||
TQueue<FDTFluxQueuedRequest, EQueueMode::Mpsc> TempQueue;
|
||||
@ -134,7 +166,8 @@ bool UDTFluxQueuedManager::MarkRequestAsResponded(const FDTFluxQueuedRequest& Ta
|
||||
return MarkRequestAsResponded(TargetRequest.RequestId);
|
||||
}
|
||||
|
||||
bool UDTFluxQueuedManager::IsRequestPending(EDTFluxApiDataType RequestType, int32 ContestId, int32 StageId,
|
||||
bool UDTFluxQueuedManager::IsRequestPending(FGuid& OutRequestId, EDTFluxApiDataType RequestType, int32 ContestId,
|
||||
int32 StageId,
|
||||
int32 SplitId)
|
||||
{
|
||||
TQueue<FDTFluxQueuedRequest, EQueueMode::Mpsc> TempQueue;
|
||||
@ -148,6 +181,11 @@ bool UDTFluxQueuedManager::IsRequestPending(EDTFluxApiDataType RequestType, int3
|
||||
if (!bFoundMatch && Request.Matches(RequestType, ContestId, StageId, SplitId))
|
||||
{
|
||||
bFoundMatch = true;
|
||||
OutRequestId = Request.RequestId;
|
||||
UE_LOG(logDTFluxNetwork, Verbose,
|
||||
TEXT("Found pending request %s: Type=%d, ContestId=%d, StageId=%d, SplitId=%d"),
|
||||
*Request.RequestId.ToString(), (int32)Request.RequestType, Request.ContestId, Request.StageId,
|
||||
Request.SplitId);
|
||||
}
|
||||
|
||||
// Remettre dans la queue temporaire
|
||||
|
||||
Reference in New Issue
Block a user