You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2020/11/23 08:20:11 UTC
[james-project] 12/19: [REFECTORING] Remove an uneeded Flux.defer
call
This is an automated email from the ASF dual-hosted git repository.
btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 1a98f606540a9edb5439235fce37e842156edf77
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Nov 22 08:01:51 2020 +0700
[REFECTORING] Remove an uneeded Flux.defer call
---
.../main/scala/org/apache/james/jmap/routes/JMAPApiRoutes.scala | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/JMAPApiRoutes.scala b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/JMAPApiRoutes.scala
index da67b15..c9b5618 100644
--- a/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/JMAPApiRoutes.scala
+++ b/server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/routes/JMAPApiRoutes.scala
@@ -145,8 +145,8 @@ class JMAPApiRoutes (val authenticator: Authenticator,
.collectSeq())
}
- private def process(capabilities: Set[CapabilityIdentifier], mailboxSession: MailboxSession, invocation: InvocationWithContext) : SFlux[InvocationWithContext] = {
- SFlux.fromPublisher(Flux.defer(() => {
+ private def process(capabilities: Set[CapabilityIdentifier], mailboxSession: MailboxSession, invocation: InvocationWithContext) : SFlux[InvocationWithContext] =
+ SFlux.fromPublisher(
invocation.processingContext.resolveBackReferences(invocation.invocation) match {
case Left(e) => SFlux.just[InvocationWithContext](InvocationWithContext(Invocation.error(
errorCode = ErrorCode.InvalidResultReference,
@@ -154,9 +154,7 @@ class JMAPApiRoutes (val authenticator: Authenticator,
methodCallId = invocation.invocation.methodCallId), invocation.processingContext))
case Right(resolvedInvocation) => processMethodWithMatchName(capabilities, InvocationWithContext(resolvedInvocation, invocation.processingContext), mailboxSession)
.map(_.recordInvocation)
- }
- }))
- }
+ })
private def processMethodWithMatchName(capabilities: Set[CapabilityIdentifier], invocation: InvocationWithContext, mailboxSession: MailboxSession): SFlux[InvocationWithContext] =
methodsByName.get(invocation.invocation.methodName)
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org