File size: 637 Bytes
cbc00ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# -*- coding: utf-8 -*-
# Copyright (c) Alibaba, Inc. and its affiliates.


class WebsocketStreamingMode:
    # TODO how to know request is duplex or other.
    NONE = "none"  # no stream
    IN = "in"  # stream in
    OUT = "out"
    DUPLEX = "duplex"


ACTION_KEY = "action"
EVENT_KEY = "event"
HEADER = "header"
TASK_ID = "task_id"
ERROR_NAME = "error_code"
ERROR_MESSAGE = "error_message"


class EventType:
    STARTED = "task-started"
    GENERATED = "result-generated"
    FINISHED = "task-finished"
    FAILED = "task-failed"


class ActionType:
    START = "run-task"
    CONTINUE = "continue-task"
    FINISHED = "finish-task"