MagicOnion icon indicating copy to clipboard operation
MagicOnion copied to clipboard

Question: Possible to use Task and ValueTask instead of UnaryResult and such?

Open Metadorius opened this issue 2 years ago • 1 comments

Use case: I currently have a thick client in .NET Framework, but we need to decouple business logic into a separate server for security. Currently our code is using Task, all interfaces and database access objects that implement them are using tasks. We also may need to have both thick and thin clients.

Currently from what we see there are two issues:

  • we need to change all our DAOs to use UnaryResult and such instead of Task;
  • we can't use the DAOs directly in the legacy "thick client" edition.

Hence why - is it possible to use Task/ValueTask, if not atm - can that be implemented in a reasonable amount of effort?

Metadorius avatar Nov 29 '23 19:11 Metadorius

It is possible to modify to directly return Task/ValueTask, but it requires modifications in various codes and the validity needs to be examined, so there are no plans for this at the moment.

UnaryResult is exposed only at the service interface level and expects Task/ValueTask to be used for internal logic.

mayuki avatar Nov 30 '23 10:11 mayuki

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar May 29 '24 00:05 github-actions[bot]