You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/08 18:58:20 UTC
[GitHub] rabbah commented on a change in pull request #3256: Refactor some bits of the triggers API.
rabbah commented on a change in pull request #3256: Refactor some bits of the triggers API.
URL: https://github.com/apache/incubator-openwhisk/pull/3256#discussion_r167033685
##########
File path: core/controller/src/main/scala/whisk/core/controller/Triggers.scala
##########
@@ -305,59 +292,56 @@ trait WhiskTriggersApi extends WhiskCollectionAPI {
private def activateRules(user: Identity,
args: JsObject,
rulesToActivate: Map[FullyQualifiedEntityName, ReducedRule])(
- implicit transid: TransactionId): Iterable[Future[JsObject]] = {
- rulesToActivate.map {
+ implicit transid: TransactionId): Future[Iterable[RuleActivationResult]] = {
+ val ruleResults = rulesToActivate.map {
case (ruleName, rule) =>
// Invoke the action. Retain action results for inclusion in the trigger activation record
- val actionActivationResult: Future[JsObject] = postActivation(user, rule, args)
+ postActivation(user, rule, args)
.flatMap { response =>
response.status match {
case OK | Accepted =>
Unmarshal(response.entity).to[JsObject].map { activationResponse =>
- val activationId: JsValue = activationResponse.fields("activationId")
+ val activationId = activationResponse.fields("activationId").convertTo[ActivationId]
Review comment:
not sure it's worth it here to convert to ActivationId only to convert it back to json.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services