Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Orleans.Runtime/Hosting/SiloBuilderStartupExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static class SiloBuilderStartupExtensions
/// <returns>
/// The provided <see cref="ISiloBuilder"/>.
/// </returns>
[Obsolete("AddStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", error: false)]
public static ISiloBuilder AddStartupTask<TStartup>(
this ISiloBuilder builder,
int stage = ServiceLifecycleStage.Active)
Expand All @@ -51,6 +52,7 @@ public static ISiloBuilder AddStartupTask<TStartup>(
/// <returns>
/// The provided <see cref="ISiloBuilder"/>.
/// </returns>
[Obsolete("AddStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", error: false)]
public static ISiloBuilder AddStartupTask(
this ISiloBuilder builder,
IStartupTask startupTask,
Expand All @@ -74,6 +76,7 @@ public static ISiloBuilder AddStartupTask(
/// <returns>
/// The provided <see cref="ISiloBuilder"/>.
/// </returns>
[Obsolete("AddStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", error: false)]
public static ISiloBuilder AddStartupTask(
this ISiloBuilder builder,
Func<IServiceProvider, CancellationToken, Task> startupTask,
Expand Down
4 changes: 3 additions & 1 deletion src/Orleans.Runtime/Lifecycle/IStartupTask.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using System.Threading;
using System;
using System.Threading;
using System.Threading.Tasks;

namespace Orleans.Runtime
{
/// <summary>
/// Defines an action to be taken after silo startup.
/// </summary>
[Obsolete("IStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", error: false)]
public interface IStartupTask
{
/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion src/api/Orleans.Runtime/Orleans.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,13 @@ public static ISiloBuilder Configure<TOptions>(this ISiloBuilder builder, System

public static partial class SiloBuilderStartupExtensions
{
[System.Obsolete("AddStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", false)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo all changes under the src/api directory

Comment thread
ReubenBond marked this conversation as resolved.
Outdated
public static ISiloBuilder AddStartupTask(this ISiloBuilder builder, Runtime.IStartupTask startupTask, int stage = 20000) { throw null; }

[System.Obsolete("AddStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", false)]
Comment thread
ReubenBond marked this conversation as resolved.
Outdated
public static ISiloBuilder AddStartupTask(this ISiloBuilder builder, System.Func<System.IServiceProvider, System.Threading.CancellationToken, System.Threading.Tasks.Task> startupTask, int stage = 20000) { throw null; }

[System.Obsolete("AddStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", false)]
Comment thread
ReubenBond marked this conversation as resolved.
Outdated
public static ISiloBuilder AddStartupTask<TStartup>(this ISiloBuilder builder, int stage = 20000)
where TStartup : class, Runtime.IStartupTask { throw null; }
}
Expand Down Expand Up @@ -702,7 +705,7 @@ public partial interface IClusterMembershipService

System.Collections.Generic.IAsyncEnumerable<ClusterMembershipSnapshot> MembershipUpdates { get; }

System.Threading.Tasks.ValueTask Refresh(MembershipVersion minimumVersion = default);
System.Threading.Tasks.ValueTask Refresh(MembershipVersion minimumVersion = default, System.Threading.CancellationToken cancellationToken = default);
Comment thread
ReubenBond marked this conversation as resolved.
Outdated
System.Threading.Tasks.Task<bool> TryKill(SiloAddress siloAddress);
}

Expand Down Expand Up @@ -803,6 +806,7 @@ public partial interface ISiloStatusOracle
bool UnSubscribeFromSiloStatusEvents(ISiloStatusListener observer);
}

[System.Obsolete("IStartupTask is deprecated. Use BackgroundService or IHostedService instead. See https://learn.microsoft.com/dotnet/orleans/host/configuration-guide/startup-tasks for more information.", false)]
Comment thread
ReubenBond marked this conversation as resolved.
Outdated
public partial interface IStartupTask
{
System.Threading.Tasks.Task Execute(System.Threading.CancellationToken cancellationToken);
Expand Down
2 changes: 2 additions & 0 deletions test/Tester/StartupTaskTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

using Xunit;

#pragma warning disable CS0618 // Type or member is obsolete

namespace DefaultCluster.Tests
{
[TestCategory("BVT"), TestCategory("Lifecycle")]
Expand Down
Loading