Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FluencePeer

This class implements the Fluence protocol for javascript-based environments. It provides all the necessary features to communicate with Fluence network

Hierarchy

  • FluencePeer

Index

Constructors

Accessors

Methods

Constructors

constructor

Accessors

internals

  • get internals(): { callServiceHandler: CallServiceHandler; initiateFlow: (request: RequestFlow) => void; initiateParticle: (particle: Particle, onStageChange: (stage: ParticleExecutionStage) => void) => void; regHandler: { common: (serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void; forParticle: (particleId: string, serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void } }
  • Is not intended to be used manually. Subject to change

    Returns { callServiceHandler: CallServiceHandler; initiateFlow: (request: RequestFlow) => void; initiateParticle: (particle: Particle, onStageChange: (stage: ParticleExecutionStage) => void) => void; regHandler: { common: (serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void; forParticle: (particleId: string, serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void } }

    • callServiceHandler: CallServiceHandler
    • initiateFlow: (request: RequestFlow) => void
        • (request: RequestFlow): void
        • deprecated

          Parameters

          • request: RequestFlow

          Returns void

    • initiateParticle: (particle: Particle, onStageChange: (stage: ParticleExecutionStage) => void) => void
        • (particle: Particle, onStageChange: (stage: ParticleExecutionStage) => void): void
        • Initiates a new particle execution starting from local peer

          Parameters

          • particle: Particle

            particle to start execution of

          • onStageChange: (stage: ParticleExecutionStage) => void
              • (stage: ParticleExecutionStage): void
              • Parameters

                • stage: ParticleExecutionStage

                Returns void

          Returns void

    • regHandler: { common: (serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void; forParticle: (particleId: string, serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void }
      • common: (serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void
          • (serviceId: string, fnName: string, handler: GenericCallServiceHandler): void
          • Register handler for all particles

            Parameters

            • serviceId: string
            • fnName: string
            • handler: GenericCallServiceHandler

            Returns void

      • forParticle: (particleId: string, serviceId: string, fnName: string, handler: GenericCallServiceHandler) => void
          • (particleId: string, serviceId: string, fnName: string, handler: GenericCallServiceHandler): void
          • Register handler which will be called only for particle with the specific id

            Parameters

            • particleId: string
            • serviceId: string
            • fnName: string
            • handler: GenericCallServiceHandler

            Returns void

Methods

getStatus

start

  • Initializes the peer: starts the Aqua VM, initializes the default call service handlers and (optionally) connect to the Fluence network

    Parameters

    • Optional config: PeerConfig

      object specifying peer configuration

    Returns Promise<void>

stop

  • stop(): Promise<void>
  • Un-initializes the peer: stops all the underlying workflows, stops the Aqua VM and disconnects from the Fluence network

    Returns Promise<void>

Static isInstance

  • Checks whether the object is instance of FluencePeer class

    Parameters

    • obj: FluencePeer

      object to check if it is FluencePeer

    Returns boolean

    true if the object is FluencePeer false otherwise

Generated using TypeDoc