Skip to content

Conversation

sairanjit
Copy link
Member

  • Add support to process the messages concurrently

cc: @Zzocker : Taking it further from #1276

@TimoGlastra From the earlier conversations how can we handle the queue from inbound transport?

  • Can we use the event emitter ?

Copy link

changeset-bot bot commented Sep 9, 2024

⚠️ No Changeset found

Latest commit: f9de361

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sairanjit sairanjit marked this pull request as ready for review September 13, 2024 08:15
@sairanjit sairanjit force-pushed the feat/concurrent-message-processing branch from da1b2a1 to 3281bc5 Compare September 13, 2024 08:16
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

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

Good updates! Thanks

Comment on lines 88 to 89
filter((e) => e.payload.message.id === encryptedMessage.id),
filter((e) => e.payload.message.type === encryptedMessage.type),
Copy link
Contributor

Choose a reason for hiding this comment

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

an encrypted message does not have an id and type right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I missed this

Copy link
Member Author

@sairanjit sairanjit Sep 13, 2024

Choose a reason for hiding this comment

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

  • But here there are no common properties I can map to. Can you suggest me a way to add a guard here or filter specific encrypted message?

Zzocker and others added 5 commits September 13, 2024 16:35
…ncurrently

Signed-off-by: Pritam Singh <pkspritam16@gmail.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
@sairanjit sairanjit force-pushed the feat/concurrent-message-processing branch from 05caec4 to 9a37419 Compare September 13, 2024 11:06
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
observable
.pipe(
filter((e) => e.type === AgentEventTypes.AgentMessageProcessed),
filter((e) => deepEquality(e.payload.encryptedMessage, encryptedMessage)),
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 we can just check for equality right (===)? AS the object will be passed around? Using deep object equality can be expensive

}

public async dispatch(messageContext: InboundMessageContext): Promise<void> {
public async dispatch(messageContext: InboundMessageContext, encryptedMessage?: EncryptedMessage): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

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

What if we add encryptedMessage to the InboundMessageContext ( as it's related to the incoming message)

filter((e) => e.type === AgentEventTypes.AgentMessageProcessed),
filter((e) => deepEquality(e.payload.encryptedMessage, encryptedMessage)),
timeout({
first: 10000, // timeout after 10 seconds
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 it's less relevant here to await the processing? As we don't do anything afterwards

filter((e) => e.type === AgentEventTypes.AgentMessageProcessed),
filter((e) => deepEquality(e.payload.encryptedMessage, encryptedMessage)),
timeout({
first: 10000, // timeout after 10 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add this as a param to the constructor of the HttpInboundTransport class?

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
@TimoGlastra
Copy link
Contributor

@sairanjit can you resolve the conflicts? I think we're good to merge!

…t/concurrent-message-processing

Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
@sairanjit
Copy link
Member Author

@TimoGlastra Resolved conflicts now

@sairanjit sairanjit requested a review from TimoGlastra October 10, 2024 14:28
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

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

Thanks so much for processing all the feedback!!

@TimoGlastra TimoGlastra enabled auto-merge (squash) October 11, 2024 06:41
@TimoGlastra TimoGlastra merged commit 5a8f536 into openwallet-foundation:main Oct 11, 2024
14 checks passed
auer-martin pushed a commit to auer-martin/aries-framework-javascript that referenced this pull request Oct 15, 2024
…on#2026)

Signed-off-by: Pritam Singh <pkspritam16@gmail.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Co-authored-by: Pritam Singh <pkspritam16@gmail.com>
Signed-off-by: Martin Auer <martin.auer97@gmail.com>
genaris pushed a commit to genaris/credo-ts that referenced this pull request Oct 9, 2025
…on#2026)

Signed-off-by: Pritam Singh <pkspritam16@gmail.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Co-authored-by: Pritam Singh <pkspritam16@gmail.com>
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
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.

3 participants