Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Make useful api public
Browse files Browse the repository at this point in the history
  • Loading branch information
shana committed Jan 9, 2019
1 parent a116d5f commit 4cd00a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions src/GitHub.Api/Tasks/ActionTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace GitHub.Unity
{
class TaskQueue : TPLTask
public class TaskQueue : TPLTask
{
private TaskCompletionSource<bool> aggregateTask = new TaskCompletionSource<bool>();
private readonly List<ITask> queuedTasks = new List<ITask>();
Expand Down Expand Up @@ -85,7 +85,7 @@ private void TaskFinished(bool success, Exception ex)
}
}

class TaskQueue<TTaskResult, TResult> : TPLTask<List<TResult>>
public class TaskQueue<TTaskResult, TResult> : TPLTask<List<TResult>>
{
private TaskCompletionSource<List<TResult>> aggregateTask = new TaskCompletionSource<List<TResult>>();
private readonly List<ITask<TTaskResult>> queuedTasks = new List<ITask<TTaskResult>>();
Expand Down Expand Up @@ -190,7 +190,7 @@ private void TaskFinished(TTaskResult result, bool success, Exception ex)
}
}

class TPLTask : TaskBase
public class TPLTask : TaskBase
{
private Task task;

Expand Down Expand Up @@ -235,7 +235,7 @@ protected override void Run(bool success)
}
}

class TPLTask<T> : TaskBase<T>
public class TPLTask<T> : TaskBase<T>
{
private Task<T> task;

Expand Down Expand Up @@ -280,7 +280,7 @@ protected override T RunWithReturn(bool success)
}
}

class ActionTask : TaskBase
public class ActionTask : TaskBase
{
protected Action<bool> Callback { get; }
protected Action<bool, Exception> CallbackWithException { get; }
Expand Down Expand Up @@ -329,7 +329,7 @@ protected override void Run(bool success)
}
}

class ActionTask<T> : TaskBase
public class ActionTask<T> : TaskBase
{
private readonly Func<T> getPreviousResult;

Expand Down Expand Up @@ -415,7 +415,7 @@ protected virtual void Run(bool success, T previousResult)
public T PreviousResult { get; set; } = default(T);
}

class FuncTask<T> : TaskBase<T>
public class FuncTask<T> : TaskBase<T>
{
protected Func<bool, T> Callback { get; }
protected Func<bool, Exception, T> CallbackWithException { get; }
Expand Down Expand Up @@ -468,7 +468,7 @@ protected override T RunWithReturn(bool success)
}
}

class FuncTask<T, TResult> : TaskBase<T, TResult>
public class FuncTask<T, TResult> : TaskBase<T, TResult>
{
protected Func<bool, T, TResult> Callback { get; }
protected Func<bool, Exception, T, TResult> CallbackWithException { get; }
Expand Down Expand Up @@ -513,7 +513,7 @@ protected override TResult RunWithData(bool success, T previousResult)
}
}

class FuncListTask<T> : DataTaskBase<T, List<T>>
public class FuncListTask<T> : DataTaskBase<T, List<T>>
{
protected Func<bool, List<T>> Callback { get; }
protected Func<bool, FuncListTask<T>, List<T>> CallbackWithSelf { get; }
Expand Down Expand Up @@ -573,7 +573,7 @@ protected override List<T> RunWithReturn(bool success)
}
}

class FuncListTask<T, TData, TResult> : DataTaskBase<T, TData, List<TResult>>
public class FuncListTask<T, TData, TResult> : DataTaskBase<T, TData, List<TResult>>
{
protected Func<bool, T, List<TResult>> Callback { get; }
protected Func<bool, Exception, T, List<TResult>> CallbackWithException { get; }
Expand Down
8 changes: 4 additions & 4 deletions src/GitHub.Api/Tasks/TaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public override string ToString()
public virtual string Message { get; set; }
}

abstract class TaskBase<TResult> : TaskBase, ITask<TResult>
public abstract class TaskBase<TResult> : TaskBase, ITask<TResult>
{
private event Action<bool, TResult> finallyHandler;

Expand Down Expand Up @@ -723,7 +723,7 @@ protected override void CallFinallyHandler()
public TResult Result { get { return result; } }
}

abstract class TaskBase<T, TResult> : TaskBase<TResult>
public abstract class TaskBase<T, TResult> : TaskBase<TResult>
{
private readonly Func<T> getPreviousResult;

Expand Down Expand Up @@ -770,7 +770,7 @@ protected virtual TResult RunWithData(bool success, T previousResult)
public T PreviousResult { get; set; } = default(T);
}

abstract class DataTaskBase<TData, TResult> : TaskBase<TResult>, ITask<TData, TResult>
public abstract class DataTaskBase<TData, TResult> : TaskBase<TResult>, ITask<TData, TResult>
{
public DataTaskBase(CancellationToken token)
: base(token)
Expand All @@ -783,7 +783,7 @@ protected void RaiseOnData(TData data)
}
}

abstract class DataTaskBase<T, TData, TResult> : TaskBase<T, TResult>, ITask<TData, TResult>
public abstract class DataTaskBase<T, TData, TResult> : TaskBase<T, TResult>, ITask<TData, TResult>
{
public DataTaskBase(CancellationToken token)
: base(token)
Expand Down
2 changes: 1 addition & 1 deletion src/GitHub.Api/Tasks/TaskExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace GitHub.Unity
{
static class TaskExtensions
public static class TaskExtensions
{
public static async Task StartAwait(this ITask source, Action<Exception> handler = null)
{
Expand Down

0 comments on commit 4cd00a6

Please sign in to comment.