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

Improve EnvironmentResponse handling API #806

Open
keithralphs opened this issue Jan 28, 2025 · 0 comments
Open

Improve EnvironmentResponse handling API #806

keithralphs opened this issue Jan 28, 2025 · 0 comments

Comments

@keithralphs
Copy link
Contributor

Currently the EnvironmentResponse class contained a boolean initialized field and a string error_message field, the combination of whic is used to determine what action is taken during WorkerDispatcher initialization. At the moment this decision is spread across multiple lines and is not immediately clear on what the acceptable/valid states are without detailed knowledge of the class. The correct interpretation should be as follows:

  initialized=True initialized=False
error_message is None Return Block until next poll
error_message is not None Undefined Raise

This should be encapsulated in e.g. a dedicated enum field so that he logic is fixed and can be interpreted based on an explicit set of possibilities

Acceptance Criteria

  • The EnvironmentResponse class contains a single field that encapsulates the interpretation logic described as known states which can be directly compared
  • The new field is updated automatically by the class when the state of its constituent parts changes
  • The affected interpretations of the class have been migrated to use the new field
  • Tests have been provided to validate the behaviour for eaxh allowed state of the field
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