using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Tango.Core.Threading
{
///
/// Represents a task that will be awaited for a limited time.
/// If the timeout has reached, the task will return and will continue in the background.
///
public class LimitedTimeTask
{
private Action _action;
private TimeSpan _timeout;
private bool _completed;
public LimitedTimeTask(Action action, TimeSpan timeout)
{
_action = action;
_timeout = timeout;
}
public Task Run()
{
TaskCompletionSource