[TH2-3249]#266
Draft
lumber1000 wants to merge 8 commits intomessage_pipeline_refactoring_cradle_2_20from
Draft
Conversation
cordwelt
reviewed
Apr 19, 2022
|
|
||
| @Suppress("MemberVisibilityCanBePrivate") | ||
| class Context( | ||
| class Context constructor( |
Comment on lines
+42
to
+46
| Executors.newFixedThreadPool(configuration.codecRequestThreadPool.value.toInt()).asCoroutineDispatcher() | ||
| ) | ||
|
|
||
| private val callbackScope = CoroutineScope( | ||
| Executors.newFixedThreadPool(configuration.codecCallbackThreadPool.value.toInt()).asCoroutineDispatcher() |
Contributor
There was a problem hiding this comment.
Do we really need separate thread pools for these scopes? Maybe they can share a single one?
Comment on lines
+65
to
+70
| val firstSequence = | ||
| decodedBatch.groupsList.firstOrNull()?.messagesList?.firstOrNull()?.sequence | ||
| val lastSequence = | ||
| decodedBatch.groupsList?.lastOrNull()?.messagesList?.lastOrNull()?.sequence | ||
| val stream = | ||
| "${decodedBatch.groupsList.firstOrNull()?.messagesList?.firstOrNull()?.message?.sessionAlias}:${decodedBatch.groupsList.firstOrNull()?.messagesList?.firstOrNull()?.message?.direction.toString()}" |
Contributor
There was a problem hiding this comment.
Suggested change
| val firstSequence = | |
| decodedBatch.groupsList.firstOrNull()?.messagesList?.firstOrNull()?.sequence | |
| val lastSequence = | |
| decodedBatch.groupsList?.lastOrNull()?.messagesList?.lastOrNull()?.sequence | |
| val stream = | |
| "${decodedBatch.groupsList.firstOrNull()?.messagesList?.firstOrNull()?.message?.sessionAlias}:${decodedBatch.groupsList.firstOrNull()?.messagesList?.firstOrNull()?.message?.direction.toString()}" | |
| val firstMessage = decodedBatch.groupsList.firstOrNull()?.messagesList?.firstOrNull()?.message | |
| val lastMessage = decodedBatch.groupsList.lastOrNull()?.messagesList?.lastOrNull()?.message | |
| val firstSequence = firstMessage?.sequence | |
| val lastSequence = lastMessage?.sequence | |
| val stream = "${firstMessage?.sessionAlias}:${firstMessage?.direction.toString()}" |
Comment on lines
+123
to
+126
| val sessionAlias = | ||
| request.protobufRawMessageBatch.groupsList | ||
| .first().messagesList | ||
| .first().rawMessage.metadata.id.connectionId.sessionAlias |
Contributor
There was a problem hiding this comment.
Suggested change
| val sessionAlias = | |
| request.protobufRawMessageBatch.groupsList | |
| .first().messagesList | |
| .first().rawMessage.metadata.id.connectionId.sessionAlias | |
| val sessionAlias = request.protobufRawMessageBatch.groupsList[0] | |
| .messagesList[0] | |
| .rawMessage | |
| .sessionAlias |
Comment on lines
+108
to
+113
| val firstSequence = | ||
| request.protobufRawMessageBatch.groupsList.first()?.messagesList?.first()?.rawMessage?.sequence | ||
| val lastSequence = | ||
| request.protobufRawMessageBatch.groupsList.last()?.messagesList?.last()?.rawMessage?.sequence | ||
| val stream = | ||
| "${request.protobufRawMessageBatch.groupsList.first()?.messagesList?.first()?.rawMessage?.sessionAlias}:${request.protobufRawMessageBatch.groupsList.first()?.messagesList?.first()?.rawMessage?.direction.toString()}" |
Contributor
There was a problem hiding this comment.
Same as above. Also why do we use first/last here, but firstOrNull/lastOrNull above?
Comment on lines
+135
to
+140
| val firstSequence = | ||
| request.protobufRawMessageBatch.groupsList.first()?.messagesList?.first()?.rawMessage?.sequence | ||
| val lastSequence = | ||
| request.protobufRawMessageBatch.groupsList.last()?.messagesList?.last()?.rawMessage?.sequence | ||
| val stream = | ||
| "${request.protobufRawMessageBatch.groupsList.first()?.messagesList?.first()?.rawMessage?.sessionAlias}:${request.protobufRawMessageBatch.groupsList.first()?.messagesList?.first()?.rawMessage?.direction.toString()}" |
cordwelt
approved these changes
Apr 21, 2022
Contributor
cordwelt
left a comment
There was a problem hiding this comment.
LGTM, but I think someone from maintainers should look at this too
|
|
||
| suspend fun sendToCodec(request: CodecBatchRequest): CodecBatchResponse { | ||
| return withContext(requestSenderScope.coroutineContext) { | ||
| while (pendingRequests.keys.size > maximumPendingRequests) { |
Contributor
There was a problem hiding this comment.
Suggested change
| while (pendingRequests.keys.size > maximumPendingRequests) { | |
| while (pendingRequests.size > maximumPendingRequests) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
codec gRPC interface