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

Refactor client configuration API #178

Open
huard opened this issue Apr 21, 2020 · 0 comments
Open

Refactor client configuration API #178

huard opened this issue Apr 21, 2020 · 0 comments

Comments

@huard
Copy link
Contributor

huard commented Apr 21, 2020

Description

At the moment, the WPSClient's arguments are set at instantiation, and there is no public API to go from async to sync mode. The language setting can be changed, but at the expense of possibly shadowing processe with the same name.

These are the attributes for which we would want an API:

  • self._converters = converters
  • self._interactive = progress
  • self._mode = ASYNC if progress else SYNC
  • self.language
  • self.languages

Options

  • A configuration attribute object (.settings, .config, ._config, etc.) which would shadow only one name.
  • A more extensive refactoring, where processes are defined inside a specific process attribute, so the call would be wps.process.word_counter().
  • Same idea but with explicit mode : wps.sync.word_counter, wps.async.word_counter.

Note that currently, changing the language using the language property will not reload the process descriptions, so maybe there is no point in being able to change the language after instantiation.

Maybe a first simple step is just to remove the properties and store the languages with underscores.

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

No branches or pull requests

1 participant