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 # 186322997: S-BIAD877 could not be loaded #762

Merged
merged 11 commits into from
Oct 27, 2023

Conversation

Juan-EBI
Copy link
Contributor

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

  • refactor to use async flow rather than blocking sequence

fun deserializeSubmission(file: File): Submission

suspend fun deserializeSubmission(file: File, source: FileSourcesList): Submission
@Blocking
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jhoanmanuelms lets start using this one so we know when a code is blocking

Copy link
Contributor

@jhoanmanuelms jhoanmanuelms left a comment

Choose a reason for hiding this comment

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

LGTM. Is looking good getting rid of all the sequences to favor flows 👍

files
.collect { file ->
count.getAndIncrement()
logger.info { "writting file ${count.get()}" }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this message might be confusing since it's only displaying a number and we might have several concurrent files, perhaps we should include more info such as the file name

val file = Files.createTempFile("file-list", "${files.size}-files")
val serializer = SerializationConfig.serializationService()
file.outputStream().use { serializer.serializeFileList(files.asSequence(), format, it) }
return file.toFile()
file.outputStream().use { serializer.serializeFileList(files.asFlow(), format, it) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this also be executed in the IO context?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes but it will require the function to be suspended and we use it as a top level. So because it is a test I think runBlocking will do.

@Juan-EBI Juan-EBI merged commit a37054a into master Oct 27, 2023
@Juan-EBI Juan-EBI deleted the feature/pivotal-186322997 branch October 27, 2023 09:17
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