Node SDK

Interface LeoCron

Legend

  • Namespace
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Method
  • Enumeration
  • Class

This is the set of operations that act on the RStreams bus instance's bot DynamoDB table that tracks all bots, the checkpoints for those bots to various queues and other information. It is rare indeed that a developer would ever need to use these to interact directly with the bot DynamoDB table.

Note! This is named LeoCron because the DynamoDB table is named LeoCron for legacy reasons. It will likely get a more current name in the future, like "BotManager". The term Cron was historically associated with the bot concept because initially, bots were only invoked on a cron and did not support invocation on a push or pull model as they do today.

Hierarchy

  • LeoCron

Index

Methods

  • buildPayloads(cron: CronData, prev: any, opts: any): void
  • checkLock(cron: CronData, runid: string, remainingTime: number, callback: Callback<AWSError>): void
  • Check if a bot is currently locked, meaning running right now.

    Parameters

    • cron: CronData

      ??

    • runid: string

      The ID of the bot running right now to check for

    • remainingTime: number

      ??

    • callback: Callback<AWSError>

      A callback that will be called if something goes wrong

    Returns void

  • checkpoint(id: string, event: string, params: Checkpoint, callback: Callback<AWSError>): void
  • Set a checkpoint on a bot. A bot checkpoints a position it has read to in a queue it reads from and marks the last position it wrote to for queues that it writes to. The position is an event ID.

    Parameters

    • id: string

      The ID of the bot to checkpoint

    • event: string

      The queue to checkpoint for this bot

    • params: Checkpoint

      The checkpoint details themselves that will be saved

    • callback: Callback<AWSError>

      A callback that will be called if something goes wrong

    Returns void

  • createBot(id: string, bot: any, opts: any): void
  • Used internally by the SDK to create a new bot. This should only ever be used if creating a bot that does not go through cloud formation.

    Parameters

    • id: string
    • bot: any
    • opts: any

    Returns void

  • createLock(id: string, runid: string, maxDuration: number, callback: Callback<AWSError>): void
  • Lock the given bot, marking it as currently running. Only one instance of a bot is meant to be running except in the special case of bots that are fanned out, meaning multiple instances of the same bot are running to scale horizontally.

    Parameters

    • id: string

      The ID of the bot to mark running and thus "lock"

    • runid: string

      The ID that represents this instance of the running bot

    • maxDuration: number

      How long to allow the bot to run dor

    • callback: Callback<AWSError>

      A callback that will be called if something goes wrong

    Returns void

  • end(status: any, opts: any, callback: any): void
  • internal

    Don't use.

    Parameters

    • status: any
    • opts: any
    • callback: any

    Returns void

  • getAttachedSystem(id: string): void
  • Get system by ID not by alias.

    Parameters

    • id: string

    Returns void

  • getAttachedSystemByAlias(alias: string[]): void
  • getCheckpoint(botId: string, queue: string): Promise<any>
  • Get checkpoint data for the bot and the given queue.

    Parameters

    • botId: string

      The ID of the bot to get checkpoint data for

    • queue: string

      The queue to get checkpoint data for connected to this bot

    Returns Promise<any>

    A promise so it can play nice with async/await that contains the checkpoint data

  • getLastResult(): void
  • hasMoreToDo(oldImage: any, newImage: any, key: any): void
  • internal

    Don't use.

    Parameters

    • oldImage: any
    • newImage: any
    • key: any

    Returns void

  • removeLock(id: string, runid: string, callback: Callback<AWSError>): void
  • Remove the lock on the given bot, marking it as not currently running.

    Parameters

    • id: string

      The ID of the bot to mark not running and thus remove the lock on

    • runid: string

      The ID that represents this instance of the running bot

    • callback: Callback<AWSError>

      A callback that will be called if something goes wrong

    Returns void

  • Mark a bot done running.

    Parameters

    • cron: CronData

      ??

    • runid: string

      The ID of the bot running right now to mark complete

    • status: string

      ??

    • log: any

      ??

    • opts: ReportCompleteOptions

      Whether to force it to comlete

    • callback: Callback<AWSError>

      A callback that will be called if something goes wrong

    Returns void

  • run(event: any, handler: any, callback: any): void
  • internal

    Don't use.

    Parameters

    • event: any
    • handler: any
    • callback: any

    Returns void

  • runAgain(): void
  • Tells the SDK that as soon as this bot ends, run it again. Most of the time developers don't need to do this as the SDK will just do the right thing.

    Returns void

  • schedule(id: string, duration: Date | Moment | DurationInputArg1): Promise<void>
  • Schedule a one-time invocation of the bot named id using duration to know when to do so.

    Parameters

    • id: string

      The name of the bot to invoke

    • duration: Date | Moment | DurationInputArg1

      When to invoke it

    Returns Promise<void>

  • setMessage(message: string): void
  • internal

    Don't use. Sets an in-memory message in the registry.

    Parameters

    • message: string

    Returns void

  • shouldRun(oldImage: any, newImage: any, cache: any, callback: any): void
  • internal

    Don't use.

    Parameters

    • oldImage: any
    • newImage: any
    • cache: any
    • callback: any

    Returns void

  • start(event: any, opts: any, callback: any): void
  • internal

    Don't use.

    Parameters

    • event: any
    • opts: any
    • callback: any

    Returns void

  • subscribe(id: string, queue: string, data: BotData): void
  • trigger(cron: { id: string }, callback: Callback<AWSError>): void
  • Immediately trigger the bot named cron.id, meaning invoke the underlying code (usually a lambda).

    Parameters

    • cron: { id: string }

      This contains id which is the name of the bot to invoke

      • id: string
    • callback: Callback<AWSError>

      A callback that will be called if something goes wrong

    Returns void

  • Update bot data in the RStreams bus instances's bot DynamoDB table.

    Parameters

    • bot: BotData

      The bot data to save on the bot

    • callback: Callback<AWSError>

      A callback that will be called if something goes wrong

    Returns void

Generated using TypeDoc