@polywrap/concurrent-plugin-js
TypeScript icon, indicating that this package has built-in type declarations

0.12.0 • Public • Published

@polywrap/concurrent-plugin-js

The Concurrent plugin enables wraps running within the Polywrap client to run multiple invocations in parallel. This implementation utilizes JavaScript Promises for concurrent tasks.

Interface

The Concurrent plugin implements an existing wrap interface at wrapscan.io/polywrap/concurrent@1.0.

Usage

Add the concurrent plugin to the Polywrap client's configuration:

import { PolywrapClient, ClientConfigBuilder } from "@polywrap/client-js";
import { concurrentPromisePlugin } from "@polywrap/concurrent-plugin-js";

const config = new ClientConfigBuilder()
  .addPackage(
    "wrapscan.io/polywrap/concurrent@1.0",
    concurrentPromisePlugin({ })
  )
  .build();

const client = new PolywrapClient();

Now wraps that depend upon the concurrent interface will be using the "concurrent promise plugin" implementation.

For more usage examples see src/__tests__.

Readme

Keywords

none

Package Sidebar

Install

npm i @polywrap/concurrent-plugin-js

Weekly Downloads

88

Version

0.12.0

License

MIT

Unpacked Size

43.5 kB

Total Files

20

Last publish

Collaborators

  • polywrap-build-bot
  • dorgjelli