Skip to content

Commit

Permalink
Add self param to RunTask.
Browse files Browse the repository at this point in the history
  • Loading branch information
veblush committed Jun 23, 2016
1 parent ebba595 commit fd47d8e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions core/Akka.Interfaced/InterfacedActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,23 +535,23 @@ Task<TReturn> IRequestWaiter.SendRequestAndReceive<TReturn>(IRequestTarget targe

// async support

protected new void RunTask(Action action)
protected void RunTask(Action action, IActorRef self = null)
{
RunTask(() =>
{
action();
return Task.FromResult(0);
});
}, self);
}

protected new void RunTask(Func<Task> function)
protected void RunTask(Func<Task> function, IActorRef self = null)
{
RunTask(function, false);
RunTask(function, false, self);
}

protected void RunTask(Func<Task> function, bool isReentrant)
protected void RunTask(Func<Task> function, bool isReentrant, IActorRef self = null)
{
Self.Tell(new TaskRunMessage { Function = function, IsReentrant = isReentrant });
(self ?? Self).Tell(new TaskRunMessage { Function = function, IsReentrant = isReentrant });
}

// other messages
Expand Down

0 comments on commit fd47d8e

Please sign in to comment.