forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompletedAsyncResult.cs
More file actions
24 lines (21 loc) · 863 Bytes
/
Copy pathCompletedAsyncResult.cs
File metadata and controls
24 lines (21 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.Contracts;
namespace System.Web.Http.SelfHost.ServiceModel.Channels
{
//An AsyncResult that completes as soon as it is instantiated.
internal class CompletedAsyncResult : AsyncResult
{
public CompletedAsyncResult(AsyncCallback callback, object state)
: base(callback, state)
{
Complete(true);
}
public static void End(IAsyncResult result)
{
Contract.Assert(result != null, "CompletedAsyncResult was null.");
Contract.Assert(result.IsCompleted, "CompletedAsyncResult was not completed!");
AsyncResult.End<CompletedAsyncResult>(result);
}
}
}