Skip to content

Match for async lambda doesn't return awaiter and isn't awaited #73

@jmrnilsson

Description

@jmrnilsson

First and foremost:
Thanks an absolutely awesome library. I still prefer this to new and improved null-handling as of today.

Case in point. I'm sending an async lamdba into .Match() and the only way to awaiter is to assign the task to a canonical value outside the lamdba scope.

Below statement will just fire-and-forget.

							messages.Match
							(
								some: async msgs =>
								{
									var lastReferenceId = await messageRepository.AddRange(msgs);
									lastReferenceId.MatchSome(referenceId => FasterOps.Instance.Value.TruncateUntil(referenceId));
									logger.LogInformation("Flushed records");
								},
								none: () => delayCoefficient = 10
							);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions