question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration guide 4.1.0 > 5.0.1

See original GitHub issue

Is there any plans for a migration guide, noticed Task<Unit> being used since the latest update. Current Wiki documentation doesn’t mention anything as of yet. Noticed the release is very new so potentially in the works?

More than happy to chip in if I can help anywhere.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:9
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
delight-bycommented, Jul 5, 2018

@TheRubble you can get rid of the Unit (specifically return Unit.Value) in handlers by using AsyncRequestHandler<Request>. Other places you’ll ever encounter the Unit are IMediator.Send that returns Task<Unit> and calling handlers without MediatR in tests - no big deal.

@jbogard What I don’t understand though is where the AsyncRequestHandler<Request, Response> did go? It’s absence now forces devs to use AsyncRequestHandler in one handlers and IRequestHandler in others - one more illogical thing for a new dev on the project to learn. Any plans to return it?

3reactions
jbogardcommented, Jun 5, 2018

Just to summarize the changes, there are 2 main flavors of requests: those that return a value, and those that do not. The ones that do not now implement IRequest<T> where T : Unit. This was to unify requests and handlers into one single type. The diverging types broke the pipeline for many containers, the unification means you can use pipelines for any kind of request.

It forced me to add the Unit type in all cases, so I’ve added some helper classes for you.

  • IRequestHandler<T> - implement this and you will return Task<Unit>.
  • AsyncRequestHandler<T> - inherit this and you will return Task.
  • RequestHandler<T> - inherit this and you will return nothing (void).

For requests that do return values:

  • IRequestHandler<T, U> - you will return Task<U>
  • RequestHandler<T, U> - you will return U

I got rid of the AsyncRequestHandler<T, U> because it really wasn’t doing anything after the consolidation, a redundant base class.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migration Guides · hibernate/hibernate-orm Wiki
Hibernate's core Object/Relational Mapping functionality - Migration Guides · hibernate/hibernate-orm Wiki.
Read more >
Migration Guide - Hibernate Validator
Express validation rules in a standardized way using annotation-based constraints and benefit from transparent integration with a wide variety of ...
Read more >
Migration Guides - ESP32 - — ESP-IDF Programming ...
ESP-IDF 5.x Migration Guide . Migration from 4.4 to 5.0 · Migration from 5.0 to 5.1 · Migration from 5.1 to 5.2 ·...
Read more >
Migration Guide from Hibernate Search 4.x to 5.0
The aim of this guide is to assist you migrating an existing application based on a fairly recent version of Hibernate Search 4,...
Read more >
Release Notes Migration Toolkit for Applications 5.0
This document describes new features, known issues, and resolved issues for the Migration Toolkit for Applications 5.0. Making open source more inclusive. Red ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found