Show / Hide Table of Contents

Class DelayedActionRenderer<T>

An IActionRenderer<T> version of DelayedRenderer<T>.

Decorates an IActionRenderer<T> instance and delays the events until blocks are confirmed the certain number of blocks. When blocks are recognized the delayed events relevant to these blocks are relayed to the decorated IActionRenderer<T>.

Inheritance
Object
DelayedRenderer<T>
DelayedActionRenderer<T>
Implements
IActionRenderer<T>
IRenderer<T>
Inherited Members
DelayedRenderer<T>.Renderer
DelayedRenderer<T>.Store
DelayedRenderer<T>.Confirmations
DelayedRenderer<T>.Tip
DelayedRenderer<T>.Logger
DelayedRenderer<T>.Confirmed
DelayedRenderer<T>.DiscoverBlock(Block<T>, Block<T>)
Namespace: Libplanet.Blockchain.Renderers
Assembly: Libplanet.dll
Syntax
public class DelayedActionRenderer<T> : DelayedRenderer<T>, IActionRenderer<T>, IRenderer<T> where T : IAction, new()
Type Parameters
Name Description
T

An IAction type. It should match to BlockChain<T>'s type parameter.

Examples
IStore store = GetStore();
IActionRenderer<ExampleAction> actionRenderer = new SomeActionRenderer();
// Wraps the actionRenderer with DelayedActionRenderer; the SomeActionRenderer instance
// becomes to receive event messages only after the relevent blocks are confirmed
// by 3+ blocks.
actionRenderer = new DelayedActionRenderer<ExampleAction>(
   actionRenderer,
   store,
   confirmations: 3);
// You must pass the same store to the BlockChain<T>() constructor:
var chain = new BlockChain<ExampleAction>(
   ...,
   store: store,
   renderers: new[] { actionRenderer });

Constructors

| Improve this Doc View Source

DelayedActionRenderer(IActionRenderer<T>, IStore, Int32)

Creates a new DelayedRenderer<T> instance decorating the given renderer.

Declaration
public DelayedActionRenderer(IActionRenderer<T> renderer, IStore store, int confirmations)
Parameters
Type Name Description
IActionRenderer<T> renderer

The renderer to decorate which has the actual implementations and receives delayed events.

IStore store

The same store to what BlockChain<T> uses.

Int32 confirmations

The required number of confirmations to recognize a block. See also the Confirmations property.

Properties

| Improve this Doc View Source

ActionRenderer

The inner action renderer which has the actual implementations and receives delayed events.

Declaration
public IActionRenderer<T> ActionRenderer { get; }
Property Value
Type Description
IActionRenderer<T>

Methods

| Improve this Doc View Source

OnTipChanged(Block<T>, Block<T>, Block<T>)

Declaration
protected override void OnTipChanged(Block<T> oldTip, Block<T> newTip, Block<T> branchpoint)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
Block<T> branchpoint
Overrides
Libplanet.Blockchain.Renderers.DelayedRenderer<T>.OnTipChanged(Libplanet.Blocks.Block<T>, Libplanet.Blocks.Block<T>, Libplanet.Blocks.Block<T>)
| Improve this Doc View Source

RenderAction(IAction, IActionContext, IAccountStateDelta)

Declaration
public void RenderAction(IAction action, IActionContext context, IAccountStateDelta nextStates)
Parameters
Type Name Description
IAction action
IActionContext context
IAccountStateDelta nextStates
| Improve this Doc View Source

RenderActionError(IAction, IActionContext, Exception)

Declaration
public void RenderActionError(IAction action, IActionContext context, Exception exception)
Parameters
Type Name Description
IAction action
IActionContext context
Exception exception
| Improve this Doc View Source

RenderBlock(Block<T>, Block<T>)

Declaration
public override void RenderBlock(Block<T> oldTip, Block<T> newTip)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
Overrides
Libplanet.Blockchain.Renderers.DelayedRenderer<T>.RenderBlock(Libplanet.Blocks.Block<T>, Libplanet.Blocks.Block<T>)
| Improve this Doc View Source

RenderBlockEnd(Block<T>, Block<T>)

Declaration
public void RenderBlockEnd(Block<T> oldTip, Block<T> newTip)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
| Improve this Doc View Source

RenderReorg(Block<T>, Block<T>, Block<T>)

Declaration
public override void RenderReorg(Block<T> oldTip, Block<T> newTip, Block<T> branchpoint)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
Block<T> branchpoint
Overrides
Libplanet.Blockchain.Renderers.DelayedRenderer<T>.RenderReorg(Libplanet.Blocks.Block<T>, Libplanet.Blocks.Block<T>, Libplanet.Blocks.Block<T>)
| Improve this Doc View Source

RenderReorgEnd(Block<T>, Block<T>, Block<T>)

Declaration
public override void RenderReorgEnd(Block<T> oldTip, Block<T> newTip, Block<T> branchpoint)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
Block<T> branchpoint
Overrides
Libplanet.Blockchain.Renderers.DelayedRenderer<T>.RenderReorgEnd(Libplanet.Blocks.Block<T>, Libplanet.Blocks.Block<T>, Libplanet.Blocks.Block<T>)
| Improve this Doc View Source

UnrenderAction(IAction, IActionContext, IAccountStateDelta)

Declaration
public void UnrenderAction(IAction action, IActionContext context, IAccountStateDelta nextStates)
Parameters
Type Name Description
IAction action
IActionContext context
IAccountStateDelta nextStates
| Improve this Doc View Source

UnrenderActionError(IAction, IActionContext, Exception)

Declaration
public void UnrenderActionError(IAction action, IActionContext context, Exception exception)
Parameters
Type Name Description
IAction action
IActionContext context
Exception exception

Implements

IActionRenderer<T>
IRenderer<T>
  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium