Skip to content

Commit

Permalink
[CS0618] AbstractStage Warning Disable (#6672)
Browse files Browse the repository at this point in the history
  • Loading branch information
eaba authored May 3, 2023
1 parent 29b1513 commit 90d6349
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/core/Akka.Streams/Stage/AbstractStage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ namespace Akka.Streams.Stage
/// <typeparam name="TOut">TBD</typeparam>
internal class PushPullGraphLogic<TIn, TOut> : GraphStageLogic, IDetachedContext<TOut>
{
#pragma warning disable CS0618 // Type or member is obsolete
private AbstractStage<TIn, TOut> _currentStage;
#pragma warning restore CS0618 // Type or member is obsolete
private readonly FlowShape<TIn, TOut> _shape;

/// <summary>
Expand All @@ -30,7 +32,9 @@ internal class PushPullGraphLogic<TIn, TOut> : GraphStageLogic, IDetachedContext
public PushPullGraphLogic(
FlowShape<TIn, TOut> shape,
Attributes attributes,
#pragma warning disable CS0618 // Type or member is obsolete
AbstractStage<TIn, TOut> stage)
#pragma warning restore CS0618 // Type or member is obsolete
: base(shape)
{
Attributes = attributes;
Expand Down Expand Up @@ -59,7 +63,9 @@ public PushPullGraphLogic(
/// <summary>
/// TBD
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
public AbstractStage<TIn, TOut> Stage { get; }
#pragma warning restore CS0618 // Type or member is obsolete

IMaterializer ILifecycleContext.Materializer => Materializer;

Expand Down Expand Up @@ -283,7 +289,9 @@ private void OnSupervision(Exception exception)
case Directive.Restart:
ResetAfterSupervise();
_currentStage.PostStop();
#pragma warning disable CS0618 // Type or member is obsolete
_currentStage = (AbstractStage<TIn, TOut>)_currentStage.Restart();
#pragma warning restore CS0618 // Type or member is obsolete
_currentStage.PreStart(Context);
break;
default:
Expand Down Expand Up @@ -316,14 +324,18 @@ public class PushPullGraphStageWithMaterializedValue<TIn, TOut, TMat> : GraphSta
/// <summary>
/// TBD
/// </summary>
#pragma warning disable CS0618 // Type or member is obsolete
public readonly Func<Attributes, (IStage<TIn, TOut>, TMat)> Factory;
#pragma warning restore CS0618 // Type or member is obsolete

/// <summary>
/// TBD
/// </summary>
/// <param name="factory">TBD</param>
/// <param name="stageAttributes">TBD</param>
#pragma warning disable CS0618 // Type or member is obsolete
public PushPullGraphStageWithMaterializedValue(Func<Attributes, (IStage<TIn, TOut>, TMat)> factory, Attributes stageAttributes)
#pragma warning restore CS0618 // Type or member is obsolete
{
InitialAttributes = stageAttributes;
Factory = factory;
Expand All @@ -350,10 +362,12 @@ public PushPullGraphStageWithMaterializedValue(Func<Attributes, (IStage<TIn, TOu
public override ILogicAndMaterializedValue<TMat> CreateLogicAndMaterializedValue(Attributes inheritedAttributes)
{
var stageAndMat = Factory(inheritedAttributes);
#pragma warning disable CS0618 // Type or member is obsolete
return
new LogicAndMaterializedValue<TMat>(
new PushPullGraphLogic<TIn, TOut>(Shape, inheritedAttributes,
(AbstractStage<TIn, TOut>) stageAndMat.Item1), stageAndMat.Item2);
#pragma warning restore CS0618 // Type or member is obsolete
}

/// <summary>
Expand All @@ -376,7 +390,9 @@ public class PushPullGraphStage<TIn, TOut> : PushPullGraphStageWithMaterializedV
/// <param name="factory">TBD</param>
/// <param name="stageAttributes">TBD</param>
/// <returns>TBD</returns>
#pragma warning disable CS0618 // Type or member is obsolete
public PushPullGraphStage(Func<Attributes, IStage<TIn, TOut>> factory, Attributes stageAttributes) : base(attributes => (factory(attributes), NotUsed.Instance), stageAttributes)
#pragma warning restore CS0618 // Type or member is obsolete
{
}
}
Expand Down

0 comments on commit 90d6349

Please sign in to comment.