Open
Description
Description
Hangfire throws CS4014 compilation warning when enqueuing async jobs that return ValueTask
instead of Task
.
Steps to Reproduce
Working case with Task:
public async Task ProcessDataAsync_Task(int id)
{
// Async operation
await Task.Delay(100);
// Process data
}
// Works fine, builds successfully
BackgroundJob.Enqueue(() => ProcessDataAsync_Task(123));
Failing case with ValueTask:
public async ValueTask ProcessDataAsync_ValueTask(int id)
{
// Async operation
await Task.Delay(100);
// Process data
}
// Compiler warning CS4014
BackgroundJob.Enqueue(() => ProcessDataAsync_ValueTask(123));
Expected Behavior
Hangfire should support enqueuing methods that return ValueTask
just as it supports methods that return Task
, without throwing CS4014 compilation errors.
Metadata
Metadata
Assignees
Labels
No labels