Skip to content

Commit d6a1210

Browse files
authored
Update README.md
1 parent 9088407 commit d6a1210

File tree

1 file changed

+104
-36
lines changed

1 file changed

+104
-36
lines changed

README.md

Lines changed: 104 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -77,47 +77,115 @@ controller.addListener('connection:read', (data) => {
7777
});
7878
```
7979

80-
## API Events
80+
## API Events
81+
82+
### CNCjs Events
83+
84+
#### Event: 'startup'
85+
* `data` *(Object)* data object
86+
* `data.availableControllers` *(Array)* A list of available controllers
87+
88+
#### Event: 'config:change'
89+
90+
#### Event: 'task:start'
91+
* `taskId` *(String)* task id
92+
93+
#### Event: 'task:finish'
94+
* `taskId` *(String)* task id
95+
* `code` *(Number)* exit code
96+
97+
#### Event: 'task:error'
98+
* `taskId` *(String)* task id
99+
* `error` *(Object)* error object
100+
101+
#### Event: 'controller:type'
102+
* `type` *(String)* controller type
103+
104+
#### Event: 'controller:settings'
105+
* `type` *(String)* controller type
106+
* `settings` *(Object)* controller settings
107+
108+
#### Event: 'controller:state'
109+
* `type` *(String)* controller type
110+
* `state` *(Object)* controller state
111+
112+
#### Event: 'connection:open'
113+
* `options` *(Object)* connection options
114+
115+
#### Event: 'connection:close'
116+
* `options` *(Object)* connection options
117+
118+
#### Event: 'connection:change'
119+
* `options` *(Object)* connection options
120+
* `isOpen` *(Boolean)* True if the connection is open, flase otherwise.
121+
122+
#### Event: 'connection:error'
123+
* `options` *(Object)* connection options
124+
* `error`*(Object)* error object
125+
126+
#### Event: 'connection:read'
127+
* `options` *(Object)* connection options
128+
* `data` *(String)* data to read
129+
130+
#### Event: 'connection:write'
131+
* `options` *(Object)* connection options
132+
* `data` *(String)* data to write
133+
* `context` *(Object)* associated context information
134+
135+
#### Event: 'feeder:status'
136+
* `status` *(Object)* feeder status object
137+
138+
#### Event: 'sender:status'
139+
* `status` *(Object)* sender status object
140+
141+
#### Event: 'sender:load'
142+
* `data` *(String)* data to load
143+
* `context` *(Object)* associated context information
144+
145+
#### Event: 'sender:unload'
146+
147+
#### Event: 'workflow:state'
148+
* `state` *(String)* workflow state
149+
150+
#### Event: 'message'
151+
* `message` *(String)* message string
81152

82153
### Socket.IO Events
83154

84-
Name | Description
85-
:--- | :----------
86-
connect() | Fired upon a connection including a successful reconnection.
87-
connect_error(error) | Fired upon a connection error.
88-
connect_timeout() | Fired upon a connection timeout.
89-
error() | Fired when an error occurs.
90-
disconnect() | Fired upon a disconnection.
91-
reconnect(attempt) | Fired upon a successful reconnection.
92-
reconnect_attempt() | Fired upon an attempt to reconnect.
93-
reconnecting(attempt) | Fired upon a successful reconnection.
94-
reconnect_error(error) | Fired upon a reconnection attempt error.
95-
reconnect_failed() | Fired when couldn't reconnect within `reconnectionAttempts`.
155+
#### Event: 'connect'
156+
Fired upon a connection including a successful reconnection.
96157

97-
### CNCjs Events
158+
#### Event: 'connect_error'
159+
* `error` *(Object)* error object
160+
Fired upon a connection error.
161+
162+
#### Event: 'connect_timeout'
163+
Fired upon a connection timeout.
164+
165+
#### Event: 'error'
166+
* `error` *(Object)* error object
167+
Fired when an error occurs.
168+
169+
#### Event: 'disconnect'
170+
* `reason` *(String)* either 'io server disconnect' or 'io client disconnect'
171+
Fired upon a disconnection.
172+
173+
#### Event: 'reconnect'
174+
* `attempt` *(Number)* reconnection attempt number
175+
Fired upon a successful reconnection.
176+
177+
#### Event: 'reconnect_attempt'
178+
Fired upon an attempt to reconnect.
179+
180+
#### Event: 'reconnecting'
181+
* `attempt` *(Number)* reconnection attempt number
182+
Fired upon a successful reconnection.
183+
184+
#### Event: 'reconnect_error'
185+
Fired upon a reconnection attempt error.
98186

99-
Name | Description
100-
:--- | :----------
101-
startup(data) |
102-
config:change() |
103-
task:start(taskId) |
104-
task:finish(taskId, code) |
105-
task:error(taskId, err) |
106-
controller:type(type) |
107-
controller:settings(type, settings) |
108-
controller:state(type, state) |
109-
connection:open(options) |
110-
connection:close(options) |
111-
connection:change(options, isOpen) |
112-
connection:error(options, err) |
113-
connection:read(options, data) |
114-
connection:write(options, data, context) |
115-
feeder:status(status) |
116-
sender:status(status) |
117-
sender:load(data, context) |
118-
sender:unload() |
119-
workflow:state(state) |
120-
message(message) |
187+
#### Event: 'reconnect_failed'
188+
Fired when couldn't reconnect within `reconnectionAttempts`.
121189
122190
## API Methods
123191

0 commit comments

Comments
 (0)