How to use the fluture.parallel function in fluture

To help you get started, we’ve selected a few fluture examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ahdinosaur / gyne / index.js View on Github external
const futureCurrentSpec = stackResource.list().map(StackSpec.fromInspect)

    const futureNextSpec = getConfig(rawConfig)
      .chain(config =>
        Future((reject, resolve) => {
          StackConfig.validate(config).matchWith({
            Failure: ({ value }) => {
              reject(createValidationError(value))
            },
            Success: ({ value }) => resolve(value)
          })
        })
      )
      .map(StackSpec.fromConfig)

    return Future.parallel(Infinity, [futureCurrentSpec, futureNextSpec]).map(
      ([currentSpec, nextSpec]) => {
        log.info({
          current: currentSpec,
          next: nextSpec
        })
        return diffSpecs(currentSpec, nextSpec)
      }
    )
  }
github jongold / unblockerer / index.js View on Github external
        .chain(reqs => Future.parallel(batchSize, reqs))));
github ahdinosaur / gyne / resources / stack.js View on Github external
function patch (diff) {
    return Future.parallel(Infinity, [
      patchResource(networkResource)(diff.networks),
      patchResource(volumeResource)(diff.volumes)
    ]).chain(() => patchResource(serviceResource)(diff.services))
  }
}
github arrterian / nix-env-selector / src / extension.ts View on Github external
apNixConfigPath =>
              parallel(
                1,
                apNixConfigPath([
                  Action.updateEditorConfig(
                    SELECTED_ENV_CONFIG_KEY,
                    config,
                    workspaceRoot
                  ),
                  flow(
                    Action.applyEnvByNixConfPath(getShellCmd("env")),
                    map(showStatus(Label.SELECTED_ENV_NEED_RELOAD, none))
                  ),
                  Action.askReload
                ])
              ).map(some)
          )
github ahdinosaur / gyne / resources / stack.js View on Github external
function list () {
    return Future.parallel(Infinity, [
      networkResource.list(),
      serviceResource.list(),
      volumeResource.list()
    ])
      .map(([networks, services, volumes]) => ({
        networks,
        services,
        volumes
      }))
      .map(
        evolve({
          networks: filter(complement(isDefaultNetwork))
        })
      )
  }
github ahdinosaur / gyne / resources / stack.js View on Github external
return diff => {
    return Future.parallel(10, [
      ...map(resource.create, diff.create),
      ...map(resource.update, diff.update),
      ...map(resource.remove, diff.remove)
    ])
  }
}