本文整理汇总了C#中Request.AddMarker方法的典型用法代码示例。如果您正苦于以下问题:C# Request.AddMarker方法的具体用法?C# Request.AddMarker怎么用?C# Request.AddMarker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request.AddMarker方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostError
public void PostError(Request request, VolleyError error)
{
request.AddMarker("post-error");
Response response = Response.Error(error);
mResponsePoster.Execute(new ResponseDeliveryRunnable(request, response, null));
}
示例2: PostResponse
public void PostResponse(Request request, Response response, Action runnable)
{
request.MarkDelivered();
request.AddMarker("post-response");
mResponsePoster.Execute(new ResponseDeliveryRunnable(request, response, runnable));
}
示例3: Add
public Request Add(Request request)
{
request.SetRequestQueue(this);
//��ӵ���ǰ�����б���
lock (mCurrentRequests)
{
mCurrentRequests.Add(request);
}
request.Sequence = GetSequenceNumber();
request.AddMarker("add-to-queue");
//���������Ҫ������ֱ�Ӽ��뵽�������������
if (!request.ShouldCache())
{
mNetworkQueue.Enqueue(request);
return request;
}
/*
* �Ƚ�������뵽������������У����ҽ�������ظ�����
* ��ӵ�mWaitingRequests�У�Ŀ���ǵ���һ��������ɺ�
* �����ظ�������ֱ����ӵ�������������У������ظ���
* �����������
*/
lock (mWaitingRequests)
{
String cacheKey = request.GetCacheKey();
if (mWaitingRequests.ContainsKey(cacheKey))
{
Queue<Request> stagedRequests = null;
mWaitingRequests.TryGetValue(cacheKey, out stagedRequests);
if (stagedRequests == null)
{
stagedRequests = new Queue<Request>();
}
stagedRequests.Enqueue(request);
if (VolleyLog.DEBUG)
{
VolleyLog.V("Request for cacheKey={0} is in flight,putting on hold.", cacheKey);
}
}
else
{
mWaitingRequests.Add(cacheKey, null);
mCacheQueue.Enqueue(request);
}
return request;
}
}