using System.Threading.Tasks;
using AsterNET.Manager.Action;
namespace AsterNET.Manager.Response
{
///
///
///
public class TaskResponseHandler : IResponseHandler
{
public TaskResponseHandler(ManagerAction action)
{
TaskCompletionSource = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
Action = action;
}
public TaskCompletionSource TaskCompletionSource { get; }
public ManagerAction Action { get; }
public int Hash { get; set; }
public void HandleResponse(ManagerResponse response)
{
TaskCompletionSource.TrySetResult(response);
}
public void Free() { }
}
}