Applied experiemental flags to Dapr.Jobs

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
This commit is contained in:
Whit Waldo 2025-06-21 03:02:33 -05:00
parent 6b7f9c0a20
commit 98390416c6
5 changed files with 10 additions and 9 deletions

View File

@ -11,6 +11,7 @@
// limitations under the License.
// ------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using Dapr.Common;
using Dapr.Jobs.Models;
using Dapr.Jobs.Models.Responses;
@ -33,6 +34,7 @@ namespace Dapr.Jobs;
/// exhaustion and other problems.
/// </para>
/// </summary>
[Experimental("DAPR_JOBS", UrlFormat = "https://docs.dapr.io/developing-applications/building-blocks/jobs/jobs-overview/")]
public abstract class DaprJobsClient(Autogenerated.DaprClient client, HttpClient httpClient, string? daprApiToken = null) : IDaprClient
{
private bool disposed;
@ -74,8 +76,6 @@ public abstract class DaprJobsClient(Autogenerated.DaprClient client, HttpClient
/// to require that an existing job with the same name be deleted first.</param>
/// <param name="failurePolicyOptions">The characteristics of the policy to apply when a job fails to trigger.</param>
/// <param name="cancellationToken">Cancellation token.</param>
[Obsolete(
"The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public abstract Task ScheduleJobAsync(string jobName, DaprJobSchedule schedule,
ReadOnlyMemory<byte>? payload = null, DateTimeOffset? startingFrom = null, int? repeats = null,
DateTimeOffset? ttl = null, bool overwrite = false, IJobFailurePolicyOptions? failurePolicyOptions = null,
@ -87,7 +87,6 @@ public abstract class DaprJobsClient(Autogenerated.DaprClient client, HttpClient
/// <param name="jobName">The jobName of the job.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The details comprising the job.</returns>
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public abstract Task<DaprJobDetails> GetJobAsync(string jobName, CancellationToken cancellationToken = default);
/// <summary>
@ -95,7 +94,6 @@ public abstract class DaprJobsClient(Autogenerated.DaprClient client, HttpClient
/// </summary>
/// <param name="jobName">The jobName of the job.</param>
/// <param name="cancellationToken">Cancellation token.</param>
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public abstract Task DeleteJobAsync(string jobName, CancellationToken cancellationToken = default);
internal static KeyValuePair<string, string>? GetDaprApiTokenHeader(string apiToken)

View File

@ -11,6 +11,7 @@
// limitations under the License.
// ------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using Dapr.Common;
using Microsoft.Extensions.Configuration;
using Autogenerated = Dapr.Client.Autogen.Grpc.v1;
@ -21,6 +22,7 @@ namespace Dapr.Jobs;
/// Builds a <see cref="DaprJobsClient"/>.
/// </summary>
/// <param name="configuration">An optional instance of <see cref="IConfiguration"/>.</param>
[Experimental("DAPR_JOBS", UrlFormat = "https://docs.dapr.io/developing-applications/building-blocks/jobs/jobs-overview/")]
public sealed class DaprJobsClientBuilder(IConfiguration? configuration = null) : DaprGenericClientBuilder<DaprJobsClient>(configuration)
{
/// <summary>

View File

@ -11,6 +11,7 @@
// limitations under the License.
// ------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using Dapr.Common;
using Dapr.Jobs.Models;
using Dapr.Jobs.Models.Responses;
@ -24,6 +25,7 @@ namespace Dapr.Jobs;
/// <summary>
/// A client for interacting with the Dapr endpoints.
/// </summary>
[Experimental("DAPR_JOBS", UrlFormat = "https://docs.dapr.io/developing-applications/building-blocks/jobs/jobs-overview/")]
internal sealed class DaprJobsGrpcClient(Autogenerated.Dapr.DaprClient client, HttpClient httpClient, string? daprApiToken = null) : DaprJobsClient(client, httpClient, daprApiToken: daprApiToken)
{
/// <summary>
@ -38,7 +40,6 @@ internal sealed class DaprJobsGrpcClient(Autogenerated.Dapr.DaprClient client, H
/// <param name="overwrite">A flag indicating whether the job should be overwritten when submitted (true); otherwise false to require that an existing job with the same name be deleted first.</param>
/// <param name="failurePolicyOptions">The characteristics of the policy to apply when a job fails to trigger.</param>
/// <param name="cancellationToken">Cancellation token.</param>
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public override async Task ScheduleJobAsync(string jobName, DaprJobSchedule schedule,
ReadOnlyMemory<byte>? payload = null, DateTimeOffset? startingFrom = null, int? repeats = null,
DateTimeOffset? ttl = null, bool overwrite = false, IJobFailurePolicyOptions? failurePolicyOptions = null,
@ -157,7 +158,6 @@ internal sealed class DaprJobsGrpcClient(Autogenerated.Dapr.DaprClient client, H
/// <param name="jobName">The name of the job.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The details comprising the job.</returns>
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public override async Task<DaprJobDetails> GetJobAsync(string jobName, CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(jobName))
@ -205,7 +205,6 @@ internal sealed class DaprJobsGrpcClient(Autogenerated.Dapr.DaprClient client, H
/// <param name="jobName">The name of the job.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns></returns>
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public override async Task DeleteJobAsync(string jobName, CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(jobName))

View File

@ -11,6 +11,7 @@
// limitations under the License.
// ------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using Dapr.Common.Extensions;
using Microsoft.Extensions.DependencyInjection;
@ -19,6 +20,7 @@ namespace Dapr.Jobs.Extensions;
/// <summary>
/// Contains extension methods for using Dapr Jobs with dependency injection.
/// </summary>
[Experimental("DAPR_JOBS", UrlFormat = "https://docs.dapr.io/developing-applications/building-blocks/jobs/jobs-overview/")]
public static class DaprJobsServiceCollectionExtensions
{
/// <summary>

View File

@ -11,6 +11,7 @@
// limitations under the License.
// ------------------------------------------------------------------------
using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Text.Json;
using Dapr.Jobs.Models;
@ -20,6 +21,7 @@ namespace Dapr.Jobs.Extensions;
/// <summary>
/// Provides helper extensions for performing serialization operations when scheduling one-time Cron jobs for the developer.
/// </summary>
[Experimental("DAPR_JOBS", UrlFormat = "https://docs.dapr.io/developing-applications/building-blocks/jobs/jobs-overview/")]
public static class DaprJobsSerializationExtensions
{
/// <summary>
@ -41,7 +43,6 @@ public static class DaprJobsSerializationExtensions
/// <param name="overwrite">A flag indicating whether the job should be overwritten when submitted (true); otherwise false to require that an existing job with the same name be deleted first.</param>
/// <param name="failurePolicyOptions">The characteristics of the policy to apply when a job fails to trigger.</param>
/// <param name="cancellationToken">Cancellation token.</param>
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public static async Task ScheduleJobWithPayloadAsync(this DaprJobsClient client, string jobName, DaprJobSchedule schedule,
object payload, DateTime? startingFrom = null, int? repeats = null,
JsonSerializerOptions? jsonSerializerOptions = null, DateTimeOffset? ttl = null,
@ -71,7 +72,6 @@ public static class DaprJobsSerializationExtensions
/// <param name="overwrite">A flag indicating whether the job should be overwritten when submitted (true); otherwise false to require that an existing job with the same name be deleted first.</param>
/// <param name="failurePolicyOptions">The characteristics of the policy to apply when a job fails to trigger.</param>
/// <param name="cancellationToken">Cancellation token.</param>
[Obsolete("The API is currently not stable as it is in the Alpha stage. This attribute will be removed once it is stable.")]
public static async Task ScheduleJobWithPayloadAsync(this DaprJobsClient client, string jobName, DaprJobSchedule schedule,
string payload, DateTime? startingFrom = null, int? repeats = null, DateTimeOffset? ttl = null,
bool overwrite = false, IJobFailurePolicyOptions? failurePolicyOptions = null,