Home Reference Source Repository
import Loop from 'wyst/es6/Services/Loop.js'
public class | source

Loop

Extends:

eventemitter2~EventEmitterExpressive → Loop

a basic polling Loop which rejects actions until the previous action has completed

Static Method Summary

Static Public Methods
public static

bubble(err: Error)

Bubbles async errors into the main process so we can kill this Wyst node if something is awry

Constructor Summary

Public Constructor
public

constructor(config: {})

constructor

Member Summary

Public Members
public

$: *

public
public get

Determine if blocked.

Method Summary

Public Methods
public

kill()

kills the Loop

public

pause(): *

stops Polling

public

start(): *

starts Polling

public

tick()

Main polling loop handler

public

Toggles if we should block on the next polling cycle

public

determines if we are paused or polling

Inherited Summary

From class Expressive
public static

create(): *

creates a new inherited instance

public

debug: *

public

is(state: string): *

expressive emit

public

when(): *

expressive once

Static Public Methods

public static bubble(err: Error) source

Bubbles async errors into the main process so we can kill this Wyst node if something is awry

Params:

NameTypeAttributeDescription
err Error

The error to throw

Public Constructors

public constructor(config: {}) source

constructor

Override:

Expressive#constructor

Params:

NameTypeAttributeDescription
config {}
  • optional
  • default: {}

Public Members

public $: * source

public interval: * source

public get isBlocked: boolean: * source

Determine if blocked. Prevents stacking polls if there is some external slowness

Return:

boolean

True if blocked, False otherwise.

Public Methods

public kill() source

kills the Loop

public pause(): * source

stops Polling

Return:

*

public start(): * source

starts Polling

Return:

*

public tick() source

Main polling loop handler

public toggleBlocked(): * source

Toggles if we should block on the next polling cycle

Return:

*

public togglePaused(): * source

determines if we are paused or polling

Return:

*