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

Add new flux command sleep #495 #559

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add new flux command sleep #495 #559

wants to merge 3 commits into from

Conversation

TobiasNx
Copy link
Contributor

@TobiasNx TobiasNx commented Sep 24, 2024

Resolves #495

@TobiasNx TobiasNx requested review from fsteeg and removed request for fsteeg September 26, 2024 14:37
@TobiasNx
Copy link
Contributor Author

@fsteeg could you have a look, if this would be way worth to continue

@fsteeg
Copy link
Member

fsteeg commented Sep 27, 2024

Basic idea looks good. Some issues:

  • PR description should reference the issue using closing keywords
  • I'd copy an existing module, e.g. ObjectExceptionCatcher to get the types right (current build: does not compile cannot find symbol [...] class T)
  • Formatting is off (comments), would also be avoided by copying an existing module
  • I think the flux command should be just sleep
  • The flux command needs to be added in src/main/resources/flux-commands.properties
  • The Thread.sleep needs to be wrapped in a try-catch-block, handling InterruptedException, see e.g. in the OERSI SitemapReader

@fsteeg fsteeg assigned TobiasNx and unassigned fsteeg Sep 27, 2024
@TobiasNx
Copy link
Contributor Author

Basic idea looks good. Some issues:

* PR description should reference the issue using closing keywords

* I'd copy an existing module, e.g. ObjectExceptionCatcher to get the types right (current build: does not compile `cannot find symbol [...] class T`)

* Formatting is off (comments), would also be avoided by copying an existing module

* I think the flux command should be just `sleep`

* The flux command needs to be added in `src/main/resources/flux-commands.properties`

* The `Thread.sleep` needs to be wrapped in a try-catch-block, handling `InterruptedException`, see e.g. in the OERSI [SitemapReader](https://gitlab.com/oersi/oersi-etl/-/blob/master/src/main/java/oersi/SitemapReader.java?ref_type=heads#L65)

Thanks I adjusted as suggested.
It is missing java tests. I am not sure how to add them for this specific function.

@TobiasNx TobiasNx changed the title Add draft for object sleeper #495 Add new flux command sleep #495 Oct 17, 2024
@TobiasNx TobiasNx marked this pull request as ready for review October 17, 2024 10:20
@TobiasNx TobiasNx assigned fsteeg and unassigned TobiasNx Oct 17, 2024
@TobiasNx TobiasNx requested a review from fsteeg October 17, 2024 10:38
@blackwinter
Copy link
Member

Would it make sense to enable this command to also support the Fix function use case? Just add another setter for the time unit and extract the sleep "action" into a dedicated method. Then we could easily reuse this class to implement the corresponding Fix function (see Catmandu).

@fsteeg fsteeg assigned TobiasNx and unassigned fsteeg Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

Add a flux command for waiting a specific time
3 participants