Skip to content

Refactor client configuration API #178

@huard

Description

@huard

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions