aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2023-11-27 19:11:56 +0700
committerShulhan <ms@kilabit.info>2023-12-01 13:17:30 +0700
commit22ad970d426c07bb36c3f71856ba16183377a5f4 (patch)
tree5ecddacad15fad7d3d5d38fe3ab9bbbde2e63395 /testdata
parent115adf2ed71b602204cd9fedb0e046e731aa7e38 (diff)
downloadawwan-22ad970d426c07bb36c3f71856ba16183377a5f4.tar.xz
all: handle reconnecting when streaming execution
In "/awwan/api/execute/tail" SSE endpoint, in order for client to be able to reconnect and start streaming from the last know output, we need to send the ID for each message that we send. The ID is the index of Output in slice. If client does not send Last-Event-ID, we send all Output from beginning, otherwise, we send only message start from index in Last-Event-ID.
Diffstat (limited to 'testdata')
-rw-r--r--testdata/http_server/execute/local_test.data5
1 files changed, 5 insertions, 0 deletions
diff --git a/testdata/http_server/execute/local_test.data b/testdata/http_server/execute/local_test.data
index a64b049..5cd6f5e 100644
--- a/testdata/http_server/execute/local_test.data
+++ b/testdata/http_server/execute/local_test.data
@@ -29,17 +29,22 @@ data: 2023-11-26T15:21:00Z
event: message
data: - local.aww === BEGIN: local /local.aww 1-
+id: 0
event: message
data: - local.aww --> 1: echo "test"
+id: 1
event: message
data: test
+id: 2
event: message
data: - local.aww === END
+id: 3
event: end
data: 2023-11-26T15:21:00Z
+id: 3