This is an automated email from the ASF dual-hosted git repository.
lresende pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-toree.git
The following commit(s) were added to refs/heads/master by this push:
new 5b19aac2 Fire postRunCell event after cell execution (#198)
5b19aac2 is described below
commit 5b19aac2e56a56d35c888acc4ed5e549b1f4ed7c
Author: Creepysta <[email protected]>
AuthorDate: Wed Feb 8 23:55:23 2023 +0530
Fire postRunCell event after cell execution (#198)
---
.../kernel/protocol/v5/handler/ExecuteRequestHandler.scala | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git
a/kernel/src/main/scala/org/apache/toree/kernel/protocol/v5/handler/ExecuteRequestHandler.scala
b/kernel/src/main/scala/org/apache/toree/kernel/protocol/v5/handler/ExecuteRequestHandler.scala
index a83a0260..30b88ea6 100644
---
a/kernel/src/main/scala/org/apache/toree/kernel/protocol/v5/handler/ExecuteRequestHandler.scala
+++
b/kernel/src/main/scala/org/apache/toree/kernel/protocol/v5/handler/ExecuteRequestHandler.scala
@@ -30,10 +30,11 @@ import Utilities._
import org.apache.toree.utils._
import play.api.libs.json.JsonValidationError
import play.api.libs.json.JsPath
+
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent._
import scala.util.{Failure, Success}
-import org.apache.toree.plugins.PreRunCell
+import org.apache.toree.plugins.{PostRunCell, PreRunCell}
/**
* Receives an ExecuteRequest KernelMessage and forwards the ExecuteRequest
@@ -74,7 +75,7 @@ class ExecuteRequestHandler(
actorLoader.load(SystemActorType.ExecuteRequestRelay),
(executeRequest, km, outputStream)
).mapTo[(ExecuteReply, ExecuteResult)]
-
+
if (!executeRequest.silent && kernel.pluginManager != null){
import org.apache.toree.plugins.Implicits._
kernel.pluginManager.fireEvent(PreRunCell, "outputStream" ->
outputStream)
@@ -103,6 +104,7 @@ class ExecuteRequestHandler(
.withHeader(MessageType.Outgoing.ExecuteReply)
.withMetadata(Metadata("status" -> executeReply.status))
.withContentString(executeReply).build
+
relayMsg(executeReplyMsg, relayActor)
if (executeResult.hasContent) {
@@ -110,6 +112,10 @@ class ExecuteRequestHandler(
.withIds(Seq(MessageType.Outgoing.ExecuteResult.toString.getBytes))
.withHeader(MessageType.Outgoing.ExecuteResult)
.withContentString(executeResult).build
+ if (!executeRequest.silent && kernel.pluginManager != null){
+ import org.apache.toree.plugins.Implicits._
+ kernel.pluginManager.fireEvent(PostRunCell, "executeResult" ->
executeResult)
+ }
relayMsg(executeResultMsg, relayActor)
}
}