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

Fix missing threadPoolSize param in TransactionalOutboxBuilder.build #29

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

GeorgePap-719
Copy link

No description provided.

@GeorgePap-719 GeorgePap-719 marked this pull request as draft August 22, 2024 10:06
@GeorgePap-719 GeorgePap-719 force-pushed the fix/missing-threadpoolsize-param branch from ad3e158 to 20c02f5 Compare August 22, 2024 10:15
@GeorgePap-719 GeorgePap-719 marked this pull request as ready for review August 22, 2024 10:15
@GeorgePap-719
Copy link
Author

Allowed for missing thread-pool parameter to not break backwards compatibility, even though it was not intended before.

Copy link
Collaborator

@chris-asl chris-asl left a comment

Choose a reason for hiding this comment

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

👏 for the contribution! 🎉

I've left some comments to check and also, don't forget to bump the version appropriately (example commit, README relevant section).

Comment on lines 34 to 35
@JvmName("from") // for a nicer groovy API
internal fun FixedThreadPoolExecutorServiceFactory(threadPoolSize: Int? = null): FixedThreadPoolExecutorServiceFactory {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, what's the benefit of this? 🤔
Could you provide an example of how it looks w/o it?

Copy link
Author

Choose a reason for hiding this comment

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

Without the annotation, the function is exposed like this:

      def factory = FixedThreadPoolExecutorServiceFactoryKt
        .FixedThreadPoolExecutorServiceFactory(null)

Groovy has no knowledge about extension functions. Technically, all extension functions are compiled into static methods inside a class, so that's how we can call them outside Kotlin.

Tbh, the factory is called only once, so it does not make such a difference. Up to you if keep it or not.

Comment on lines 4 to 5
import io.github.bluegroundltd.outbox.executor.FixedThreadPoolExecutorServiceFactory.Companion.DEFAULT_THREAD_NAME_FORMAT
import io.github.bluegroundltd.outbox.executor.FixedThreadPoolExecutorServiceFactory.Companion.DEFAULT_THREAD_POOL_SIZE
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are those imports really needed? 🤔 (their definitions are in the same file, no?)

Copy link
Author

Choose a reason for hiding this comment

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

Sadly, yes. Tbh I am not sure why they are necessary either.

My first thought was to extract the constants outside of the class to top-level fields. This way we can keep them private, and we would no longer need the imports. But I didn't apply the refactor to avoid creating extra non-functional differences.

@GeorgePap-719 GeorgePap-719 force-pushed the fix/missing-threadpoolsize-param branch 2 times, most recently from f8a45ea to c94a36c Compare August 22, 2024 15:11
George Papadopoulos added 2 commits August 22, 2024 18:44
@GeorgePap-719 GeorgePap-719 force-pushed the fix/missing-threadpoolsize-param branch from c94a36c to 3cf2bfe Compare August 22, 2024 15:45
Copy link
Collaborator

@chris-asl chris-asl left a comment

Choose a reason for hiding this comment

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

🚀

@GeorgePap-719 GeorgePap-719 merged commit 9c6b45f into main Aug 22, 2024
1 check passed
@GeorgePap-719 GeorgePap-719 deleted the fix/missing-threadpoolsize-param branch August 22, 2024 15:51
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