Options
All
  • Public
  • Public/Protected
  • All
Menu

RunTransaction executes given main task and manages its concurrency.

Most common AWS services guarantee at-least-once execution but not exactly-once.

The RunTransaction uses Step Function as task runner and DynamoDB as exclusive lock.

So we can run some task that supported by Step Functions task in exactly-once manner if max concurrency is 1.

Hierarchy

  • StateMachineFragment
    • RunTransactionalTask

Implements

  • IConstruct
  • IConstruct
  • IChainable

Index

Constructors

constructor

Properties

Private amount

amount: DynamoAttributeValue = DynamoAttributeValue.fromNumber(1)

endStates

endStates: INextable[]

Private getLockResultPath

getLockResultPath: string = "$.Lock"

Private lockTable

lockTable: ITable

node

node: ConstructNode

The construct tree node associated with this construct.

startState

startState: State

Private taskName

taskName: string

Accessors

id

  • get id(): string
  • Descriptive identifier for this chainable.

    Returns string

Private lockKey

  • get lockKey(): {}

Methods

Private freeLockTask

  • freeLockTask(id: string): DynamoUpdateItem

Private getLockTask

  • getLockTask(): DynamoUpdateItem

next

  • next(next: IChainable): Chain
  • Continue normal execution with the given state.

    Parameters

    • next: IChainable

    Returns Chain

Protected onPrepare

  • onPrepare(): void
  • Perform final modifications before synthesis.

    This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

    This is an advanced framework feature. Only use this if you understand the implications.

    Returns void

Protected onSynthesize

  • onSynthesize(session: ISynthesisSession): void
  • Allows this construct to emit artifacts into the cloud assembly during synthesis.

    This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

    Parameters

    • session: ISynthesisSession

      The synthesis session.

    Returns void

Protected onValidate

  • onValidate(): string[]
  • Validate the current construct.

    This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

    Returns string[]

    An array of validation error messages, or an empty array if the construct is valid.

prefixStates

  • prefixStates(prefix?: undefined | string): StateMachineFragment
  • Prefix the IDs of all states in this state machine fragment.

    Use this to avoid multiple copies of the state machine all having the same state IDs.

    Parameters

    • Optional prefix: undefined | string

      The prefix to add.

    Returns StateMachineFragment

Protected prepare

  • prepare(): void
  • Perform final modifications before synthesis.

    This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

    This is an advanced framework feature. Only use this if you understand the implications.

    Returns void

Protected synthesize

  • synthesize(session: ISynthesisSession): void
  • Allows this construct to emit artifacts into the cloud assembly during synthesis.

    This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

    Parameters

    • session: ISynthesisSession

      The synthesis session.

    Returns void

toSingleState

  • toSingleState(options?: SingleStateOptions): Parallel
  • Wrap all states in this state machine fragment up into a single state.

    This can be used to add retry or error handling onto this state machine fragment.

    Be aware that this changes the result of the inner state machine to be an array with the result of the state machine in it. Adjust your paths accordingly. For example, change 'outputPath' to '$[0]'.

    Parameters

    • Optional options: SingleStateOptions

    Returns Parallel

toString

  • toString(): string
  • Returns a string representation of this construct.

    Returns string

Protected validate

  • validate(): string[]
  • Validate the current construct.

    This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

    Returns string[]

    An array of validation error messages, or an empty array if the construct is valid.

Static isConstruct

  • isConstruct(x: any): x is Construct
  • Return whether the given object is a Construct.

    Parameters

    • x: any

    Returns x is Construct

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc