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

Pivotal ID # 186657310: Task Completion Publish Message #796

Merged

Conversation

jhoanmanuelms
Copy link
Contributor

https://www.pivotaltracker.com/story/show/186657310

  • Delegate sending the completion message to the task itself
  • Convert the call to the submission task into an async triggering
  • Sync submit waits for the async execution to finish since it's intended for small submissions

- Delegate sending the completion message to the task itself
- Convert the call to the submission task into an async triggering
- Sync submit waits for the async execution to finish since it's intended for small submissions
@jhoanmanuelms jhoanmanuelms self-assigned this Dec 21, 2023
@jhoanmanuelms jhoanmanuelms marked this pull request as ready for review January 12, 2024 17:53
Copy link
Contributor

@Juan-EBI Juan-EBI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM please consider minor comment

eventsPublisherService.requestCreated(accNo, version)
waitUntil(duration = ofMinutes(SYNC_SUBMIT_TIMEOUT)) { queryService.existByAccNoAndVersion(accNo, version) }

return queryService.getExtByAccNo(accNo)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will suggest we create the function

suspend fun <T> waitUntil(
    duration: Duration,
    interval: Duration = Duration.ofMillis(300),
    conditionEvaluator: suspend () -> Boolean,
    processFunction: suspend () -> T,
): T {
    waitUntil(duration, interval, conditionEvaluator)
    return processFunction()
}

and then here

        return waitUntil(
            ofMinutes(SYNC_SUBMIT_TIMEOUT),
            conditionEvaluator = { queryService.existByAccNoAndVersion(accNo, version) },
            processFunction = { queryService.getExtByAccNoAndVersion(accNo, version) })

wait and having a return type looks like a coomon need .

@jhoanmanuelms jhoanmanuelms merged commit ddbd96a into master Jan 16, 2024
1 check passed
@jhoanmanuelms jhoanmanuelms deleted the feature/pivotal-#186657310-submission-stages-messages branch January 16, 2024 09:35
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

Successfully merging this pull request may close these issues.

2 participants