Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
6b369c71
Commit
6b369c71
authored
May 20, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove sleep operation in WebSocketStream
parent
9bed36f5
Pipeline
#27218
passed with stages
in 7 minutes and 53 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/infra/stream.ts
src/infra/stream.ts
+5
-5
No files found.
src/infra/stream.ts
View file @
6b369c71
...
@@ -3,10 +3,6 @@
...
@@ -3,10 +3,6 @@
//
//
// 因此封装了一个`WebSocketStream`类,当每次Websocket连接中有消息到达时,往流中添加event,
// 因此封装了一个`WebSocketStream`类,当每次Websocket连接中有消息到达时,往流中添加event,
import
{
useConfig
}
from
"
@/config
"
;
import
{
sleep
}
from
"
./sleep
"
;
// 同时执行器会不断地从流中获取event进行处理。
// 同时执行器会不断地从流中获取event进行处理。
export
class
WebSocketStream
{
export
class
WebSocketStream
{
public
ws
:
WebSocket
;
public
ws
:
WebSocket
;
...
@@ -69,7 +65,11 @@ export class WebSocketStream {
...
@@ -69,7 +65,11 @@ export class WebSocketStream {
if
(
value
)
{
if
(
value
)
{
// wait some time, and then handle message from server
// wait some time, and then handle message from server
await
sleep
(
useConfig
().
streamInterval
);
//
// but now it seems that we don't need wait any more,
// so comment the following line and check if it's ok without it.
//
// await sleep(useConfig().streamInterval);
await
onMessage
(
value
);
await
onMessage
(
value
);
}
else
{
}
else
{
console
.
warn
(
"
value from ReadableStream is undefined!
"
);
console
.
warn
(
"
value from ReadableStream is undefined!
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment