Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support passing preloaded data converters to Client #1458

Open
mjameswh opened this issue Jul 8, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@mjameswh
Copy link
Contributor

mjameswh commented Jul 8, 2024

Describe the solution you'd like

At this time, all public APIs that accept DataConverters require payload converter and failure converter to be specified as paths. That requirement originally stemmed from a desire of being consistent with the way DataConverters are passed to Workflow Workers, where paths are required because these two converters need to be loaded inside the Workflow Sandbox.

It however appears that in this specific case, consistency is often counter-productive. Workflow code and client code are often part of distinct deployment units, with distinct build processes for workflow vs client code, so that’s already inconsistent. By imposing consistency, we are forcing users to adapt and complexify the build process of all non-Workflow Worker components without no real reason to do so.

Instead, we should make Client accept pre-loaded data converters. And possibly do the same for Activity-only Workers.

@ilijaNL
Copy link

ilijaNL commented Sep 22, 2024

Possible workaround for now is

const worker = await Worker.create({
    connection,
    dataConverter: await getDataConverter(),
    ...rest
  });

  const loadedDataConverter = worker.options.loadedDataConverter;
  if (loadedDataConverter)
    loadedDataConverter.failureConverter = new DefaultFailureConverter({
      encodeCommonAttributes: true,
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants