►
From YouTube: Promises in Node core
Description
OpenJS Foundation Collaborator Summit, Berlin, 2019
A
A
So
now
we
are
at
the
state
to
discuss
what
should
be
the
default
and
for
them
I.
Don't
think
it's
actually
our
duty
to
really
do
that,
and
instead
let
our
users
decide
on
that
and
that's
why
I
would
like
to
do
a
survey
and
we're
gonna
have
the
opportunity
to
gather
some
questions
from
you
about
it
and
and
to
provide
the
necessary
information
to
actually
then
do
this
survey.
It
should,
of
course,
eat
on
try
to
explain
a
couple
of
things,
have
examples
and
so
on.
A
A
So
the
problem
there
is,
if
you
have
a
dog
race
or
ball,
it
would
also
end
up
in
there
and
that's
not
cool
because
especially
was
raised.
You
do
not
care
if
it
resource
what
at
once
and
it
uses
the
underlying
promise
constructor,
which
then
ends
up
in
the
resources,
and
we
do
not
have
the
information
to
change
that
right
now.
So
this
is
an
ongoing
discussion
with
the
a-team
a
little
bit
and
there
are
too
much
tree
solutions
to
either
have
extra
type
that
could
be
implemented
to
know.
C
D
A
The
last
point
we
discussed
depth
to
large
mountain
resort
promises
on
exit
because
it
normally
means
like
we
get
often
issues
on
the
nodejs
issue.
Tracker
then
hey
I
run
my
code
and
now
I
shall
he
saw
the
promise
would
keep
and
my
process
alive,
but
my
process
accident,
what
it
means
is
that
there
was
no
high
or
anything
going
on
anymore
in
the
application
and
the
event
loop
just
ended.
A
E
So
look
for
the
most
part
we're
not
going
through
and,
like
my
training,
I'm
like
what
new
API
should
be,
or
not
like
at
least
the
pattern
that
we've
done
right
now
is
we're
not
like
recreating
all
the
API
is
from
first
principles
and
rethinking
them
we're
taking
something
that
already
had
a
callback
interface
and
giving
it
a
promise,
interface
and
generally
trying
to
do
something.
That's
a
little
bit
better
than
the
status
quo
so
like.
If
you
think
about
what
we
have
in
the
past
and.
E
Happened
with
ffs
is
like
the
first
off.
There
were
no
promise
implementations
at
all
then
util
promises
I.
Thank
you
right.
Ezel
promise.
Five
is
a
really
great
utility
and
then
just
trimming
when
I
get
this
wrong.
If
I
do
it
allows
you
to
take
a
callback
based,
API
node
and
turn
it
into
a
promise
returning
API,
but
it
uses
underlying
the
mechanisms
to
create
that
promise.
So
no.
A
So,
actually,
in
doing
that
on
and
C++
layer
prevented
and
the
be
a
team
from
optimizing,
the
promise
instructor
and
more
in
this
case,
because
the
C++
there
could
be
optimized
and
having
regular
code
could
be
optimized
further.
At
least
that's
what
benedicto
at
some
point
and
young
might
who's
not
looking
or
listening.
A
A
A
E
E
A
G
F
E
Going
back
in,
you
told
that
promise
five
I
was
like
our
first
major
push
to
try
to
add
promise
for
as
many
as
possible.
James
had
worked
on
FS
promises.
That
was,
you
know,
a
more
direct
implementation
that
specific
to
those
FS
ap
is
that
exposed
promise
based
AP
is
for
I
believe
just
the
asynchronous
interfaces
correct,
so
I
believe
that
was
the
first
one
and
then
yeah
we
DNS
also
has
been
done.
I
think
there's
a
I
won't
call
it
abandon,
but
an
unloved
for
requests
from
me
for
child
process
I.
E
Think
in
general,
though
it
can
be
non-trivial
you're
touching
a
non-trivial
America
to
do
these
reef
actors
and
to
make
these
new
AP
eyes.
But
the
API
surface
is
defined,
there's
examples
of
other
AP
eyes
that
have
already
been
done
and
if
we
at
least
as
a
group
agree
that
this
is
something
we
want
done.
I
think
this
can
be
a
good
way
of
leveling
up
new
contributors
by
identifying
the
yes,
they
can
work
on.
C
Yeah,
a
lot
of
folks
have
made
suggestions
that
you
know
we
take
an
existing
function,
accepts
a
call
back
and
if
the
call
backs
not
pass,
then
just
return
a
promise,
we
cannot
do
that
consistently.
Alright,
you
know
some
of
those
functions
already
have
return
values
if
we
change
the
return
value.
So
it's
basically
a
sudden
good
December
I
made
a
breaking
change.
C
The
way
that
we've
been
doing
this
is
to
to
make
it
the
introduction
of
a
new
promise,
like
version
three
summer
minor,
so
we're
not
breaking
any,
is
controller
any
assumptions
on
existing
API
service.
That's
why
we
have
a
vest
promise
right,
Odie
and
I
promise
as
a
separate
set
of
functions
here
and
then
the
second
point
you're,
going
to
FS
the
reason
that
the
reason
at
best
has
done
the
way
it
was
is
so
that
we
could
avoid
duplicate
code.
C
Most
of
that
of
the
async
activity
with
the
Napa
actually
happens
down
at
the
native
layer,
not
in
the
JavaScript
layer.
So
what
we
do
is
we
create
and
promising
on
the
JavaScript
side,
but
we've
resolved
it
on
the
q
plus
plus
layer
there
without
duplicating
the
code
to
also
do
the
callback
version.
So
on
the
Jas
side,
there's
you
know
it's
a
separate
set
of
functions
that
are
defined
there,
but
under
the
covers,
if
mailer
is
same
in
either
case,
DMS
was
gonna
slightly
in
two
different
ways.
C
C
E
Think
when
I
was
reviewing
that
code,
a
lot
of
kind
of
what
was
the
core
are
like
underlying
plumbing
of
FS
is
kind
of
broken
out
and
then
what's
really
different
is
just
the
interface
into
that
point,
but
I
I
guess
at
a
high
level
of
what
I
think
and
maybe
we
need
to
identify
people
and
pair
them
with
the
api's
I
think
that
these
are
really
interesting
opportunities
to
give
bounded
work.
That's
more
advanced
than
like
change
along
in
the
test,
which
is
how
we
traditionally
didn't
like
doing
our
onboarding
through
code
and
learned.
E
I
would
love
to
see
if
a
we
can
make
more
of
a
concerted
effort
for
moving
these
promised
api's
forward,
but
also
be
if
we
could
use
this
as
a
way
to
level
up.
Newer
contributors
create
new
code
owners
for
parts
of
our
code
base.
Have
people
be
more
familiar
with
expert
code
base,
but
it
will
require.
E
You
know
like
some
mentorship
and
some
oversight
and
some
support
and
I
also
think
just
in
general,
like
I
know
for
myself,
when
I
opened
up
the
child
process
1
there
was
like
a
handful
of
pushback
about
like
how
I
should
do
it
in
some
like
shedding
and
honestly
I.
Just
didn't
have
the
energy
to
finishing
I'm
quite
familiar
with
core,
so
I
can
imagine
someone
who
was
not
me
also
not
getting
it
done,
but
I
just
think.
If
we
really
want
to
tackle
this
like.
E
We
should
be
like
fairly
consistent
in
the
way
that
we
approach
it
and
review
these
things
and
have,
at
the
very
least,
maybe
some
resources
and
documenting
like
what
do
we
need
to
make
a
promise
to
API
so
that
we
aren't
like
litigating
what
the
what
the
bare,
what
what
like
our
own
expectations
are
every
single
time.
One
of
these
API
system
comes
in,
we
should
be
consistent
and
all
the
API
should
be
held
to
the
same
kind
of
like
Laura
of
expectation
and
consistency,
so
I
think
for
child
process.
E
E
And
I
just
didn't
have
time
to
like
go
through
and
litigate
all
that
stuff,
but
we
should
just
have
like
maybe
on
how
to
guide
your
mess
or
you
want
to
promise
a
fine.
Maybe
I
here
are
what
the
expectations
are
and
if
we
have
a
review
and
it's
not
an
act
like
it,
should
get
out
to
that
guide
or
it
shouldn't
it
shouldn't
be
necessary.
C
So
it's
gonna,
take
it's
not
going
to
be
complete
right.
Take
a
first
class
based
on
what
we've
already
done.
Look
that
guide
itself
is
going
to
take
a
few.
Take
some
iteration,
because
there
are
still
some
parts
of
the
existing
API
that
we're
not
quite
sure
how
and
like
I
said
it's
not
something
that
currently
we
have
a
clear
set
of
rules
that
will
apply
it
consistently
across.
We.
E
I
E
Based
on
that,
we
can
think
of
this
as
like
a
living
document.
Then
we
iterate
on
that
at
least
becomes
this,
this
source
of
truth
for
kind
of
the
history
of
creating
these
api's
and
what
the
expectations
are.
I
would
volunteer
to
help
work
on
that.
Is
there
anyone
else
who
would
help
with
creating
this
document?
E
A
E
A
B
So
one
of
the
challenges
are:
there
are
two
challenges
on
some
of
those,
especially
on
HTTP
and
those
are
related
to
how
we
receive
show
new
connections
and
because,
if
you,
if
you're,
using,
if
you're,
using
HTTP
server
or
a
net
or
you
or
you're,
building
a
protocol
on
the
third
or
the
matte
or
TLS,
you
are
essentially
putting
using
them
in
an
event
emitter.
So
we
emit
a
new
connection
as
a
new
event.
Okay,
the
hard
challenge
there.
B
If
we
need
to
decide
which
type
of
it
behind
do
we
want
to
to
provide
in
a
promise
flag
like
what
does
it
mean
to
promise
if
I,
to
two
to
four
promises
in
a
world
where
we
are
emitting,
we
are
emitting
an
event.
Okay,
if
you
are
a
gift
when
we
so
HTTP,
if
you
are
creating
an
HTTP
server,
you
doing,
it
is
need
of
create
server
and
you
pass
in
an
Android.
Okay,
we
take
request
response
right.
That,
in
fact,
is
gets
added
as
an
event
listener
to
the
requested
event.
B
Now
it
means
that
the
core
functionality
of
our
HTTP
of
HTTP
server,
which
is
the
important
part
of
Melbourne,
relies
on
Aven
commitment
now.
What
does
it
mean
to
provide
us
a
promise
API
for
that-
and
this
is
one
of
the
questions
that
we
still
at
not
answer.
There
is
certain
type
of
discussions
and
7050
eyes
that
are
being
circulated
from
there
is
Dino
is
implemented,
something
on
them
of
that
area.
I
personally,
don't
like
I,
don't
think
that's
a
great
idea,
but
that's
my
personal.
Take
yes.
B
Whatever
saying,
is
it's
putting
down
I
go
down
you
to
that
path
in
order
to
provide
it,
and
that
is
the
first
one.
So
we
have
certain
observers
are
avid
meter,
so
in
order
to
provide
an
API
promise
version
for
those,
we
need
to
figure
out.
What
is
the
pattern
for
those
okay
and
the
second
one
is
what
we
do
with
streams
again.
Requester
installs
inherits
from
streams,
so
what
I
mean?
B
B
Don't
listen,
okay,
but
you
know
that's
not
that
it's
an
API
gets
called
once
for
process
money.
Yes,
so
it's
not
really!
You
know
we're
not
gonna,
be
providing
effective
user
experience,
you're,
not
improving
on
the
day
to
day.
Okay,
so
you
know
that's
I
just
wanted
to
say
there
is
a
kind
of
a
blocker
for
this.
If
we
need
to
figure
out
what
those
means
and
if
you're
interested,
if
users
are
less
and
they
are,
but
that's
if
you
have
some
time
at
the
end
that
will
just
show
my
dear.
F
B
B
B
J
B
Inheritance
change
for
a
lot
of
things,
so
essentially
in
order
to
replace
those.
So
we
cannot
do
the
challenge
between
these
and
promises,
for
example,
if
that
as
a
side
effect
of
primes,
it
is
a
full
new
implementation.
Okay,
with
a
magnetometer
I
meant,
a
meter
is
as
part
of
a
as
I
inhale
hierarchy,
so
HTTP
server
inherit
from
an
emitter.
So
we
probably
can
not
follow
the
same
approach
or
we
need
to
think
if
we
want
to
do
to
form
a
different
approach,
but
that
you
mean
it
might
need
to.
A
K
J
A
Can
you
elaborate,
a
more
sure
was
able
to
come
okay,
so
if
we
have
an
option,
a.
J
Specific
option
unless
we
use
it
unless
it's
used
wisely
buddy
uses
any
kind
of
trust
users
to
use
wisely.
You
could
damage
your
reputation.
People
might
see
it
come
along
unnecessarily
and
that
something
you
don't
want.
I've
got
I'll,
take
every
step
not
to
alarm
anybody.
Even
the
talk.
The
word
execute
I
will
throw.
J
A
A
It
just
to
give
you
an
outline
exactly
work.
Thank
so
none
just
suppresses
any
warnings
that
are
currently
large
at
the
moment
when
you're
running
into
our
rejection,
using
no
chances
but
mark
multiple
states.
First
of
all,
it
would
block
warning
and
that
you
would
have
an
objection,
the
second
it
would
first
like
for
the
very
first
one
that
is
longer,
but
also
tell
you.
This
is
duplicated
and
please
handle
all
your
rejections
and
I
do
believe.
A
There's
anything
mister,
singing
I,
don't
have
a
mic
right,
Hemi
right
now,
uma
that
gives
you
an
additional
context,
little
bit
how
I
would
like
where
the
error
originated
from.
So
this
is
the
current
warning
thing
and
if
you
opt
into
the
warning
mode,
it
would
still
do
the
regular
warning
and
give
you
the
context
where
it
came
from
without
certification
warning
indicating
and
the
strict
mode
would
not
accept
with
a
non
zero
exit
code
by
default.
What
a
dozens
that
is
when
you're
running
into
an
animal
to
rejection.
A
That
would
then
turn
that
on
an
objection
into
an
uncaught
exception,
which
then
has,
by
default
of
majeste,
the
behavior
of
them
exiting
the
process
with
a
non
zero
exit
code,
because
that's
the
process
for
uncaught
exceptions
in
general,
that's,
and
so
the
you
could
still
stop
that
by
having
an
uncaught
exception
hook,
which
would
mean
that
the
process
could
continue
long
staff
or
whatever
the
user
would
wish
to
have
the
default.
So
that's
how
it
works,
and
please,
okay,
great.
So
thank
you
very
much
for
the
feedback.
G
B
D
B
A
Okay,
so
I
hope
it's
like
from
from
hearing
all
these
different
opinions
of
it's
fair.
To
give
like
a
hotline
of
what
my
feeling
is
I
mean
the
this
room
would
mainly
wish
as
a
default,
and
that
sounds
like
it
would
be
this
big
boat.
Probably
there's
someone
strongly
disagree
with
that.
I,
don't
see
any
hands,
cool
I!
Think
that's!
Actually
a
pretty
nice
outcome
just
tuned
for
our
as
a
recommendation
and.
I
A
Definitely
there
are
a
lot
of
people
that
are
not
here
and
I.
Don't
want
to
decide
anything
in
here,
but
just
to
just
to
make
it
clear.
My
deal
here
is
nothing
to
decide
here
all
right,
and
so
what
I
do
want
to
oh
I
wish
at
least
is
I,
asked
every
single
one
of
you
to
open
up
this
issue
and
to
go
to
the
document.
A
Is
there
anything
else
on
this
topic?
Otherwise,
I
would
continue.
Does
anyone
wanna
have
something?
No
good
I
am.
Does
anyone
disagree
with
it
like
with
my
suggestion,
No,
okay,
well,
I.
Hope
you
think
it's
a
good
idea
and
let's
go
to
the
amount
you
know
to
the
multiple
resource
book,
so
this
is
bit
tricky
because
it's
moment
it
is
not
really
a
good
use
case
because
of
the
false
positives
in
a
way
yeah.
It's
a
personal
question
to
to
Google.
A
A
G
Multiple
results
is
a
hook
created
for
us
after
we
asked
for
it
in
the
last
column
summit
and
we
didn't
specify
full
enough,
and
this
is
my
cot
and
we
didn't
think
about
all
those
edge
cases
and
I.
Think
the
big
challenge
in
multiple
resolves
right
now
is
class
I,
don't
mind
even
like
I,
probably
won't
go
through
the
process
that
I
don't.
A
A
All
right,
let's
hope
we
can
move
forward
with
their
topic
soon,
because
I
personally
believe
we
should
try
to
have
the
best
of
bargaining
experience
for
our
users
when
it
comes
to
promises
possible,
and
that
would
be
part
of
it
and
because-
and
they
might
run
into
issues
there
and
all
the
way
off,
because
the
promise
constructor
is
pretty
much
damsel.
You
don't
know
what
happens
there.
If
the
promise
is
already
settled
because
it
cannot
change
the
state
afterwards
anymore,
you
can
do
it
might
result
again
or
reject
afterwards.
A
A
The
promise
constructor
that
when,
when
there
is
a
synchronous,
arrow
and
a
promise
constructor,
it
would
be
rejected
right
and
that's
good,
and
if
you
call
tiger
the
reject
or
the
result
function,
that
would
be
settled
like
as
soon
as
you
have
it
rejected
all
resolved.
Let's
call
sac
and
then
it
is
in
a
new
state
and
cannot
change
that
stage
afterwards
anymore.
A
It
will
always
say:
reject
them
only
salt,
but
the
problem
with
that
is
that
the
promise
constructor
that
does
not
prevent
any
further
code
to
be
executed
in
the
constructor,
even
though
it
is
already
sound.
Now,
if
there
is
a
second
arrow
or
a
second
Rhys
or
something
like
that
in
there,
it
will
still
be
executed
and
it
could
cause
side
effects
and
arrows
that
we
don't
understand
in
the
output,
because
you
don't
see
that
because
just
silent
pretty
much
it's
a
damsel
from
the
code.
F
J
A
Benjamin
is
going
to
show
you
a
nice
example.
It's
only
about
the
inspector
the
prompts
construct,
a
new
promise
and
then
the
function
receives
up
to
two
arguments,
which
is
the
resolve
and
the
reject
right.
You
then,
you
can
then
call
in
the
promise
constructor
to
settle
it,
but
you
can
call
this
function
or
both
functions
multiple
times,
which
would
cause
the
promise
not
to
change
the
stage.
The
second
time
you
call
it
and
it
would
also
not
take
any
value.
If
we
like.
G
D
G
C
C
It's
interesting
to
note
that
there
was
just
recently
on
Twitter
suppose
we're
debating
with
me
about
whether
local
resolve
should
be
allowed,
and
the
argument
was
is
that
we
should
we
shouldn't
do
anything
here.
It's
let
him
resolve
multiple
clients,
and
the
argument
literally
was
that
resource.
We
can't
happen
with
promises,
like
you
know,
there's
this
perception
out
there.
A
K
H
Exposing
more
debug
information
to
people
sounds
free
and
I.
Don't
think
we're
gonna
change
these
things
in
the
JavaScript
standard.
There's
a
lot
of
things
about
promises
that
I
personally
find
very
variable
and
I.
Think
you
magnified
like
other
things
that
I
wouldn't
have
thought
of.
It's
like
you
know,
there's
many
dimensions
of
and
at
the
same
time,.
H
H
H
I
H
G
G
G
H
H
A
I
F
F
F
There's
a
major
separation
of
concerns
that
I'm,
seeing
here
like
I'm,
like
the
platform
like
shouldn't,
have
to
like
write
a
bunch
of
code
to
like
stop
developers
from
shooting
themselves
in
the
foot,
because
the
spec
was
bad.
You
know
like
the
real
thing,
should
be
pitching
the
spec
but
I'm
like
I
guess,
for
whatever
reason,
that's
not
possible,
not
sure
why?
But
I
don't
want
to
get
some.
B
F
Just
curious
like,
wouldn't
you
guys
think
that
would
be
useful
to
like
have
a
link
like
like
quinton
plugins
that
we
like
are
like?
Oh
so,
like
widely
recognized
in
flinching
rules?
For
note,
just
like,
say:
hey
community
like
there's,
you
know
stuff,
you
can
do
that's
gonna
like
hurt
you
and
we
really
recommend
you.
You
know
just
because
you
can
do
it
doesn't
mean
you
should
yeah
so
forth.
So
that's
just
a
way
to
kind
of
programmatically
like
like
identify
just.
A
G
D
G
Warnings,
that's
not
statically,
like
you
get
a
prompt,
your
name,
you
don't
know
that
might
be
promise
and
then
or,
for
example,
one
of
the
biggest
issues
people
have
is
that
they
made
promises
in
denim.
They
don't
return
back
and
then
he
doesn't
wait
for
the
for
them.
I
feel
like
80%
or
85%
of
these
cases
can
be
called
statically,
and
then
there
is
like
15
that
can't,
but
the
problem
business,
the
15,
are
the
hardest
first
and
actually
know
some
good
people
that
would
love
to
collaborate
with
you
on.
D
A
Thanks
a
lot,
and
so
the
problem
there
is,
as
I
said
before,
on
the
nodejs
issue,
tracker
people
representing
frequently
come
in
and
have
say
like
hey,
my
program
ended,
but
my
promise
never
resolved
and
my
program
should
not
M
before
my
promises.
Well,
it
normally
only
resolves
if
there
is
nothing
else
going
on
in
the
program
anymore,
because
then
the
event
loop
is
empty
and
no
J's
cannot
detect
anything
anymore
promise,
there's
nothing
that
keeps
the
event
global
and
so
and
as
soon
as
we
resolve
and
then
it
would
be
some
work
again.
A
Colonel
James
and
the
process
would
kept
like,
but
obviously
the
promise
never
resolved.
So
this,
in
fact,
in
the
program
and
because
in
the
branch
which
normally
it
results
in
the
promise
to
be
resolved,
was
not
reached,
and
this
is
confusing
for
users
and
would
be
great
to
actually
notify
everyone
about
it.
So
I've
spoken
to
be
are
aware
and
on
access
able
to
iterate
over
the
heap,
which
means
the
seasons,
which
means
we
are
able
to
detect
what
the
objects
are
they're
still
alive,
and
then
we
check
is
it
actually
a
promise?
D
A
G
Think
this
is
also
like.
Why
is
it
my
code
running
like
it's
running
to
debug
errors?
It's
even
more
frustrating,
at
least
for
me
to
debug
code,
where
code
doesn't
want
and
I
don't
understand.
Why
and
on
results
like
unsettle
purposes
can
be
really
frustrating
to
debug
for
some
users
included
I.
Think,
for
the
very
reason
should
expose
this
somehow,
even
if
you
don't
want
to
lock
box
by
default,
because
there
are
cases
where
programs
ending
with
the
process,
which
at
least
have
some
way
to
monitor
this
or
device.