Skip to content

Commit

Permalink
refactor!: replace old MPSC/SPSC queues with JCTools
Browse files Browse the repository at this point in the history
- Refactored the Queues class and made all queue creations converge to it (except for tests).
- Introduced Infrastructure#useUnsafeForQueues to decide when to use unpadded vs atomic variants.
- Introduced native compilation smoke tests.

Issue: #1330

BREAKING CHANGE: constants and methods have been removed from io.smallrye.mutiny.helpers.queues.Queues
as well as previous MPSC/SPSC classes in the io.smallrye.mutiny.helpers.queues package.
  • Loading branch information
jponge committed Oct 25, 2023
1 parent 3774685 commit becbf47
Show file tree
Hide file tree
Showing 23 changed files with 493 additions and 1,184 deletions.
4 changes: 4 additions & 0 deletions implementation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<artifactId>smallrye-common-annotation</artifactId>
<version>${smallrye-common-annotation.version}</version>
</dependency>
<dependency>
<groupId>org.jctools</groupId>
<artifactId>jctools-core</artifactId>
</dependency>

<dependency>
<groupId>io.reactivex.rxjava3</groupId>
Expand Down
45 changes: 44 additions & 1 deletion implementation/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,50 @@
"criticality" : "highlight",
"minSeverity" : "POTENTIALLY_BREAKING",
"minCriticality" : "documented",
"differences" : [ ]
"differences" : [
{
"ignore": true,
"code": "java.method.removed",
"old": "method <T> java.util.Queue<T> io.smallrye.mutiny.helpers.queues.Queues::createStrictSizeQueue(int)",
"justification": "Refactoring of internal APIs"
},
{
"ignore": true,
"code": "java.field.removedWithConstant",
"old": "field io.smallrye.mutiny.helpers.queues.Queues.TO_LARGE_TO_BE_BOUNDED",
"justification": "Typo (internal API)"
},
{
"ignore": true,
"code": "java.class.removed",
"old": "class io.smallrye.mutiny.helpers.queues.MpscLinkedQueue<T>",
"justification": "Refactoring of internal APIs"
},
{
"ignore": true,
"code": "java.class.removed",
"old": "class io.smallrye.mutiny.helpers.queues.SpscArrayQueue<E>",
"justification": "Refactoring of internal APIs"
},
{
"ignore": true,
"code": "java.class.removed",
"old": "class io.smallrye.mutiny.helpers.queues.SpscLinkedArrayQueue<E>",
"justification": "Refactoring of internal APIs"
},
{
"ignore": true,
"code": "java.field.removed",
"old": "field io.smallrye.mutiny.helpers.queues.Queues.BUFFER_S",
"justification": "Refactoring of internal APIs"
},
{
"ignore": true,
"code": "java.field.removed",
"old": "field io.smallrye.mutiny.helpers.queues.Queues.BUFFER_XS",
"justification": "Refactoring of internal APIs"
}
]
}
}, {
"extension" : "revapi.reporter.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import io.smallrye.common.annotation.CheckReturnValue;
import io.smallrye.mutiny.CompositeException;
import io.smallrye.mutiny.Multi;
import io.smallrye.mutiny.helpers.queues.Queues;
import io.smallrye.mutiny.infrastructure.Infrastructure;
import io.smallrye.mutiny.operators.multi.MultiConcatMapOp;
import io.smallrye.mutiny.operators.multi.MultiFlatMapOp;
Expand Down Expand Up @@ -77,7 +76,7 @@ public MultiFlatten<I, O> withRequests(int requests) {
*/
@CheckReturnValue
public Multi<O> merge() {
return merge(Queues.BUFFER_S);
return merge(Infrastructure.getBufferSizeS());
}

/**
Expand Down

This file was deleted.

Loading

0 comments on commit becbf47

Please sign in to comment.