Comments (10)
Part of the works was done in #58
@chafilin can you show me links to the code, where you have problems in replacing Promise?
from server.
@chafilin don’t forget about tests. They are the main users of .then
.
from server.
Part of the works was done in #58
@chafilin can you show me links to the code, where you have problems in replacing Promise?
This kind of Promises:
Line 106 in b47dccd
Line 42 in b47dccd
from server.
Yeap. Let’s keep Promise in those 2 examples.
I am waiting for PR to replace then
in tests.
from server.
The current list of .then
in project
➜ rg "\.then"
server-client.js
275: .then(result => {
base-server.js
388: .then(() => Promise.all(before))
389: .then(keys => new Promise((resolve, reject) => {
405: promise = promise.then(() => {
410: promise.then(() => {
420: return promise.then(() => {
424: }).then(() => {
921: }).then(access => {
960: }).then(() => emitSubscribed())
964: }).then(access => {
test/force-promise.test.js
4: return forcePromise(() => Promise.resolve('result')).then(result => {
11: return forcePromise(() => Promise.resolve().then(() => {
19: return forcePromise(() => 'result').then(result => {
test/base-server.test.js
580: app.destroy().then(() => {
test/stress/client.js
70: delay(Math.random() * 10000).then(() => {
test/stress/backend.js
46: let processing = delay(500).then(() => {
50: processing = processing.then(() => {
52: }).then(() => {
58: }).then(() => {
62: processing = processing.then(() => {
64: }).then(() => {
68: processing.then(() => {
Seems like we have only a few lines to close this issue.
from server.
a369b48
b99e4be
72f6894
6399e06
66d61c4
from server.
What is the reason for the forcePromise
module? You can await
promises and non-promises.
from server.
API was created before await
.
Good idea to remove it. Do you want to send PR?
from server.
Hmm, I would, but one test fails and I don't know why.
The test reports about errors during channel authorization
has this assertion:
expect(test.names).toEqual(['add', 'clean', 'error', 'add', 'clean'])
But test.names
is ['add', 'error', 'add', 'clean', 'clean']
without the forcePromise
.
from server.
- I forgot to say you send PR to
v0.6
branch instead ofmaster
- You can find reports content in
test.reports
. Comparing `test.reports before and after changes could help you with finding a difference. It is OK if the content is the same, but only the order was changed. - If it will become too complicated you can send failing PR, I will help with tests.
from server.
Related Issues (20)
- Change the repo description HOT 1
- Maximum call stack size exceeded HOT 6
- `SyncMap`: allow the developer to halt operation finish HOT 1
- Do not attach 'request' listener if custom http server is provided HOT 6
- Allow to return void in addSyncMap HOT 7
- Question API HOT 1
- Multi-subscribe or Push subscribtions to client? HOT 2
- Wrong meta key in Context#sendBack HOT 3
- Safer shutdown
- Better Host output in human readable log
- Save context between steps HOT 2
- Do not resend action back to the creator HOT 1
- Brute-force protcetion for control server HOT 1
- Rename LOGUX_CONTROL_PASSWORD to LOGUX_CONTROL_SECRET HOT 1
- Extra control server protection with IP mask HOT 1
- Allow cookie based auth HOT 1
- Federatio support
- Add Server#autoloadModules HOT 2
- HTTP proxy server rejects request with { "version": 3, ... } HOT 1
- Add verbose mode for the server to provides additional details HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from server.