Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced Receive(Func<T, Task> handler) by ReceiveAsync(...) #1747

Merged
merged 1 commit into from
Mar 15, 2016

Conversation

JeffCyr
Copy link
Contributor

@JeffCyr JeffCyr commented Mar 3, 2016

Marked Receive(Func<T, Task> handler) as obsolete and replaced it by ReceiveAsync.

This prevents from calling the asynchronous Receive by mistake (e.g. EndpointManager)

@Aaronontheweb
Copy link
Member

@JeffCyr need to run the API approval change process: http://getakka.net/docs/akka-developers/public-api-changes

@JeffCyr
Copy link
Contributor Author

JeffCyr commented Mar 3, 2016

@Aaronontheweb Done

@rogeralsing
Copy link
Contributor

I'm all in favor for this, its the correct design for the API.
There are a few overloads of the sync Receive. we should probably add those as well for the async versions.

protected void Receive<T>(System.Func<T, System.Threading.Tasks.Task> handler) { }
protected void Receive<T>(System.Action<T> handler, System.Predicate<T> shouldHandle = null) { }
protected void Receive<T>(System.Predicate<T> shouldHandle, System.Action<T> handler) { }
protected void Receive<T>(System.Func<T, bool> handler) { }
protected void Receive(System.Type messageType, System.Func<object, bool> handler) { }
protected void ReceiveAny(System.Action<object> handler) { }

@JeffCyr
Copy link
Contributor Author

JeffCyr commented Mar 13, 2016

I implemented the missing overloads except protected void Receive<T>(System.Func<T, bool> handler) which is hard to implement with current design.

rogeralsing added a commit that referenced this pull request Mar 15, 2016
Replaced Receive(Func<T, Task> handler) by ReceiveAsync(...)
@rogeralsing rogeralsing merged commit b107397 into akkadotnet:dev Mar 15, 2016
@JeffCyr JeffCyr deleted the receiveasync-rename branch May 22, 2016 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants