Last active
December 16, 2015 10:39
-
-
Save jaredjenkins/5421919 to your computer and use it in GitHub Desktop.
Polling for completed requests in MonoBehavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Update() | |
{ | |
//the http worker has a method which returns (dequeues) | |
//an IEnumerable set of completed requests, | |
//internall it is enqueueing the completed requests | |
foreach(ApiResponse response in httpWorker.GetCompletedResponses()) | |
{ | |
if(response.Request.RequestCompleteHandler != null) | |
{ | |
//we want to notify an object that we have completed the request | |
response.Request.RequestCompleteHandler(response.Request.Url, response.ResponseData); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment