►
From YouTube: HXUG July 2020 Jeremy Clark Async Await
Description
No description was provided for this meeting.
If this is YOUR meeting, an easy way to fix this is to add a description to your video, wherever mtngs.io found it (probably YouTube).
A
A
pretty
decent
crown
already,
so
let
me
let
me
I
guess
just
real
quick,
like
I
was
telling
jeremy
earlier,
why
I
wanted
to
have
him
come
and
do
this
talk
is
because
I
use
async
and
weight
all
the
time
in
my
xamarin
apps,
but
and
it
works
really
well
for
me
and
and
it's
great
I
love
it,
but
there's
also,
I
don't
understand
it
probably
nearly
as
well
as
I
should,
and
I
I
I
there's
some
cat.
A
You
know
gushes
I
run
into
sometimes
where
I
kind
of
realize
that
there's
more
going
on
under
the
hood
than
I
really
understand,
and
I
suspect
that
probably
most
of
us
are
in
a
similar
vote.
A
So
I
thought
it'd
be
really
good
to
have
someone
come
in
and
really
kind
of
unravel
the
you
know
the
innards
of
what's
going
on
and
help
us
understand
how
it's
actually
working
and
what
we
you
know
what
the
best
practices
are
and
what
the
worst
practices
that
we
may
be
doing
are,
and
so
that's
kind
of
why
I
why
I
asked
jeremy
to
come.
Do
this
presentation
and
take
it
away.
Jeremy
thanks.
B
Yeah
thanks
thanks
for
having
me,
I
appreciate
it
and
actually
that's
the
reason.
I
do
this
talk
because
you
know
kind
of
some
history
on
this.
B
So
of
course
it
goes
to
the
bottom
of
the
list
of
things
to
learn,
and
then
you
know
two
more
years
go
by
and
net
4.5
comes
out
and
it
has
a
weight.
Async
await
built
in
to
the
language
right
and
now
I'm
kind
of
like
this
still
looks
important
and
I
see
that
it's
a
wrapper
around
task.
B
Basically,
they
said
if
you
block
a
thread
for
more
than
I
don't
even
remember
what
it
was.
It
was
like
four
seconds:
we're
gonna
kill
your
application
automatically
because
we're
not
gonna,
let
your
apps
hang.
So
the
idea
of
you
can't
let
your
app
hang.
You
have
to
get
onto
another
thread
so
that
you
can
do
stuff.
In
the
background,
keep
your
application
responsive
now
became
kind
of
a
critical
part
of
how
we
have
to
do
programming
now.
We
all
know
how
well
windows.
B
8
went
as
far
as
applications
were
concerned,
but
we
did
end
up
with
async
and
await
along
the
way.
So
I'm
basically
the
plan
for
tonight
is
to
understand
it
better.
So
what
jason
described
is
exactly
what
I'm
going
to
talk
about
so
async
and
await
are
out
there
we're
going
to
look
at
what's
behind
them,
which
is
and
we're
going
to
basically
call
an
asynchronous
method,
get
some
data
back
from
it
handle
exceptions
and
deal
with
cancellation.
B
So
if
you
want
these
slides
and
code
samples,
you
can
go
out
to
my
website.
Jeremybites.Com
and
you'll
find
a
link
to
this
talk
along
with
a
bunch
of
resources
out
there,
so
I
might
be
showing
those
later
on.
Depending
on
what
kind
of
questions
we
have.
There's
also
kind
of
a
lot
of
supplementary
articles
that
I've
written
along
the
way
and
then
feel
free
to
follow
me
on
twitter
if
you'd,
like
I'm
jeremy,
bites
on
twitter.
B
And
I'm
just
going
to
talk
a
little
bit
of
history,
because
asynchronous
programming
has
never
been
an
easy
thing,
so
I
never
did
manual
threading
myself,
because
I
had
friends
and
co-workers
who
did
manual
threading
and
got
into
all
kinds
of
problems
with
it.
So
I
tried
to
avoid
it
as
much
as
possible,
but
throughout
the
years.net
you
know
the
the
people
who
are
building
language
and
the
compiler
said.
Let's
do
some
things
to
kind
of
make
things
easier
to
do.
Async
and
hopefully
kind
of
keep
you
out
of
trouble.
B
So
we
went
through
things
like
the
asynchronous
programming
model
or
apm
and
the
event
asynchronous
pattern
or
eap,
and
the
task
asynchronous
pattern
or
tap,
and
that's
actually
where
we
live
today
and
kind
of
looking
at
these
really
quickly
the
asynchronous
programming
model.
This
was
a
method
based
thing
where
you
basically
had
a
pair
of
methods.
B
Well,
let's
come
up
with
another
pattern
and
we'll
we're
going
to
call
this
the
event
asynchronous
pattern,
and
this
is
event
based
and
the
good
thing
about
this
is
event.
Handlers
are
kind
of
the
second
thing
you
learn
if
you're
learning
c
you
know
the
first
thing
you
learn
is
you
know
console.writeline
hello
world
and
then
the
second
thing
you
learn
is
button.click
right.
So
if
you
can
hook
up
a
button,
click
event
handler
you
can
do
asynchronous
programming.
B
So
the
event
args
would,
you
know,
have
generally
a
custom
event
args
that
would
have
your
data
in
it,
so
advantage
really
easy
to
use.
But
again
what
happens
if
something
goes
wrong?
Well,
basically,
your
event
will
never
fire
and
you're
going
to
be
left
waiting
for
something
indefinitely.
B
So
from
that
standpoint
not
real
great,
so
then
we
ended
up
with
task
and
the
task
asynchronous
pattern,
and
this
is
actually
where
we
live
today
and
when
we
talk
about
this,
it's
task
based
and
hopefully
that's
apparent
from
the
name
and
generally.
What
we
have
is
a
method
that
returns
a
task
or
a
task
of
t.
B
Now,
if
we
have
a
task
of
t
the
t
that
generic
type
represents
a
payload
coming
back.
So
if
we're
expecting
data
coming
back
from
our
asynchronous
method,
then
that
would
be
the
type
specified
for
that.
Otherwise,
you
can
have
a
task
without
a
generic
type,
and
that
would
say
well.
This
doesn't
have
any
data,
it's
returning
to
you,
but
you
still
have
access
to
the
task.
So
you
can
check
to
see
when
it's
done.
You
can
see
if
any
errors
happened.
B
The
interesting
thing
is
this
may
or
may
not
happen
on
a
separate
thread,
so
we
like
to
think
about
you,
know
asynchronous
as
multi-threaded
programming,
so
we're
we're
getting
off
our
current
thread
and
we're
spinning
up
some
other
thread
or
using
something
from
the
thread
pool
and
that's
where
this
other
thing
is
going
to
run
now.
In
some
cases
the
asynchronous
process
doesn't
require
any
thread
resources,
so
it
might
not
consume
any.
B
In
the
example
that
I'm
going
to
be
showing
tonight,
we
will
be
using
a
separate
thread
and
the
example
specifically
set
up
that
way.
So
we
can
kind
of
see
when
things
are
asynchronous
and
when
they're
not
now
the
thing
that's
really
cool
about
task
is
it's
extremely
powerful,
so
tasks
can
be
chained
and
combined
in
different
ways.
So
I
could
have
a
task
and
when
it's
done
another
task
kicks
off
and
when
that
one's
done,
another
task
kicks
off,
or
I
could
have
a
task
that
kicks
off
when
it's
done.
B
B
Now,
unfortunately,
it's
also
extremely
complex
and
that's
kind
of
where
we
run
into
the
problem
of
task.
So
I'm
going
to
flip
over
to
code
now
because
I'm
not
a
big
fan
of
slides.
I,
like
code
and,
like
I
said
these
code
samples,
are
available.
There's
a
link
on
my
website
and
these
are
all
on
github
and
I'm
not
doing
xamarin
programming
tonight,
because
I
figured
if
I
fumbled
through
xamarin.
B
That
would
be
really
embarrassing,
but
my
application
is
a
wpf
application,
so
it
does
use
xaml
at
least,
and
it
will
kind
of
show
us
some
of
the
things
in
a
desktop
world
that
we
need
to
be
concerned
about,
but
the
asynchronous
processes
are
also
really
important
on
the
web
servers
as
well,
because
if
we
end
up
blocking
threads
on
our
web
servers,
we
basically
end
up
blocking
incoming
request
threads
and
we
can
inadvertently
limit
how
many
people
can
connect
to
our
servers
at
any
one
time.
B
And
feel
free
to
slow
me
down
if
I'm
talking
way
too
fast,
and
if
you
have
any
questions,
please
feel
free
to
put
them
in
the
chat
or
unmute,
because
otherwise
it's
just
me
talking
to
my
camera,
which
is
right
here.
B
So
I
would
love
some
interaction
if
you
have
questions
so
here's
my
amazing
application
and
I
have
three
buttons.
I
have
one:
that's
fetch
data
with
task,
another
one
fetch
data
with
a
weight
and
a
cancel
button.
These
currently
do
not
do
anything
and
then
on
the
right.
I
have
a
list
box
that
will
hold
our
data
in
the
project
see
there
are
oh
okay.
B
There
are
four
projects
in
the
project
that
we
have
we're
actually
only
going
to
be
looking
at
two
files
tonight,
so
won't
be
too
confusing.
The
people.service
project
is
a
web
api
service,
and
this
is
where
we're
going
to
be
retrieving
the
data,
and
that
is
the
data
we'll
put
into
the
list
box
the
using
task.library
project.
This
is
a
library
project
that
contains
the
method,
we're
going
to
call
and
that's
an
asynchronous
method
in
that
library
and
then
the
bottom
one
task.ui.
B
And
this
is
the
method
that
we're
going
to
call
so
on
line
23,
there's
a
get
async
method
now,
generally
asynchronous
methods
end
with
the
letters
a
s
y
and
c.
That's
a
convention,
that's
not
something!
That's
required
and
I've
heard
debates
both
ways
about
whether
that's
a
good
convention
or
not.
I
go
ahead
and
follow
it
because
it's
easier
than
fighting
with
people
and
then
like
I
mentioned
the
asynchronous
method,
returns
a
task
and
in
this
case
it
returns.
A
task
of
t
r
t
happens
to
be
a
list
of
person.
B
So
what
this
is
telling
me
is
I'm
going
to
get
a
task
back
and
the
task
has
a
payload
which
is
of
type
list
of
person.
So
it's
basically
a
promise
at
some
point
in
the
future.
I
will
have
a
list
of
person
objects
and
we're
not
going
to
spend
too
much
time.
Looking
at
the
code,
that's
actually
in
this
file.
B
This
is
using
an
http
client
to
make
a
call
out
to
that
web
service,
and
but
the
one
thing
I
want
to
point
out
is
here
on
line
25,
where
I
have
a
task.delay
task.delay3000
now
in
order
to
show
that
things
are
happening.
Asynchronously.
B
I
put
an
artificial
delay
in
here
because
otherwise
calling
a
service
on
my
local
machine.
It
would
happen
close
to
instantaneously,
at
least
from
a
user
standpoint,
so
we
wouldn't
really
be
able
to
see
that
it
was
truly
asynchronous
and
that
we
were
getting
what
we
wanted.
So
I
put
an
artificial
delay
in
here
now,
if
you're
not
familiar
with
task.delay,
it's
very
similar
to
thread.sleep,
but
you
don't
have
to
feel
quite
as
dirty
when
you
use
it.
B
So
there
might
be
times
where,
for
whatever
reason,
our
application's
not
working.
But
if
I
pause
for
two
seconds,
then
it
works,
and
so
it's
tempting
to
put
a
thread.sleep
in
there
and
basically
say:
okay
go
to
sleep
for
two
seconds
and
when
you're
done,
I'm
pretty
sure
the
next
thing.
That's
in
this
method
is
gonna
work.
B
B
B
B
B
Ui
pattern
you
want
to
use,
I
want
to
focus
on
using
task
and
await
so
I'm
just
going
to
put
things
in
the
code
behind,
but
this
isn't
normally,
where
I
put
them
now.
My
code
behind
is
fairly
empty.
At
this
point,
I
have
a
button
for
my
fetch
with
or
an
event
handler.
I
should
say
for
my
task
button,
one
for
my
await
button
and
one
for
my
cancel
button
and
then
there's
a
clear
listbox
method
which
clears
out
the
items
in
the
list
box.
B
Okay,
so
I'm
going
to
pretend
that
I
don't
necessarily
have
access
to
this
code,
but
maybe
I
have
access
to
the
library
and
I'm
going
to
let
visual
studio
help
me
figure
out
how
to
use
this
get
async
method
that
I'm
looking
for
so
first,
I'm
going
to
create
a
class
level
variable
or
classable
field
to
hold
this
person.
Reader
object
and
we'll
just
call
this
reader.
B
A
B
Don't
know
the
types
that
are
coming
back
from
libraries,
and
so
I
let
visual
studio
help
me
with
this
var
is
strongly
typed.
It's
just
a
developer
shortcut
in
this
case,
and
so,
if
I
hover
over
this,
it
tells
me
what
type
it
it
is.
That's
coming
back,
and
so
on
the
first
line,
we
can
see
it's
a
task
of
t
result
and
then
down
at
the
bottom.
It
says:
t
result
is
a
list
a
person.
B
B
It
was
a
library
that
I
was
using.
That
was
returning
some
weird
event
and
I
couldn't
figure
out
the
type
I
needed
to
hook
up
and
yeah.
So
that's
awesome
and
then
we'll
change
result
to
person
task
since
that
more
closely
matches
what
we
have
okay.
So
what
we've
done
here
is
we've
kicked
off
that
asynchronous
method
and
we
have
a
task
back.
B
Okay,
great
now.
What
do
we
do
with
it
now?
Something?
That's
really
tempting
is
to
look
at
the
task
and
say:
okay,
what
properties
do
I
have
well,
there's
a
result,
property
on
the
task
and
the
result.
Property
is
actually
a
list,
a
person
okay.
So
it's
really
tempting
to
say
you
know
what
I'm
just
going
to
for
each
over
this.
So
for
each
person
in
person,
task.result.
B
B
This
application
will
never
come
back
so
yeah,
so
I
can't
move
my
application.
I
can't
interact
with
it.
I
can't
do
anything
with
it.
In
fact,
the
best
I
can
do
is
go
to
task
manager
and
say,
let's
get
rid
of
this,
so
what
I
just
did
was
create
a
deadlock,
so
using
task.result
here
is
not
good,
and
the
reason
for
that
is
because,
if
the
result
property
is
not
populated
yet
when
I
try
to
access
it,
it's
going
to
it's
going
to
wait
for
it
to
be
populated.
B
So,
in
this
case,
what's
happening
is
I'm
on
a
ui
thread
at
this
point,
and
so
the
ui
thread
is
actually
waiting
for
the
result.
Property
to
be
populated,
so
my
thread
is,
is
stopped
at
this
point
now,
unfortunately,
on
the
other
end,
the
task
is,
you
know
it's
going
through
its
process
and
populating
the
result
property,
but
then
it's
kind
of
asking
it's
waiting
for
the
ui
thread
to
say
it's
okay
to
give
the
data
back,
so
we
actually
cause
a
deadlock.
B
B
B
I
might
have
come
back
to
it
later
and
said:
okay.
Well
generally,
the
thing
that's
used,
the
most
is
put
in
slot
number
one.
So
let's
take
a
look
at
the
parameter
for
this.
B
B
B
So
what
this
is
saying
is,
I
need
a
method
that
takes
a
task
of
list,
a
person
as
a
parameter
and
returns
void.
That's
what
I
need
to
do
to
satisfy
this,
and
if
you
want
to
learn
more
about
funk
and
action
in
the
links
for
this
talk,
I
have
another
talk
about
delegates
in.net
and
that
talks
about
all
kinds
of
fun
stuff
with
funk
in
action.
B
B
Actually
it's
okay
to
use
task.result
inside
of
a
continuation,
because
the
continuation
will
not
run
until
after
that
asynchronous
process
is
done.
So
in
this
case
I
know
results
will
be
populated
unless
we
get
an
exception
or
cancellation.
So
it
will
be
populated
with
a
caveat,
so
it's
safe
to
use
task.result
here,
because
I'm
not,
I
don't,
have
to
worry
about
causing
deadlocks
or
blocking
threads.
B
B
So
unfortunately
I
don't
have
enough
experience
with
xamarin
to
know.
Do
you
have
this
problem
in
xamarin?
Anyone
absolutely
absolutely
okay
good.
So
this
is
entirely
relevant
okay.
So
the
next
thing
I
do
is,
I
say:
okay,
I
remember
I
remember
this
okay,
because
I
tried
to
do
my
own
threading
once
and
it
ended
badly,
but
I
remember
so.
You
have
to
marshal
back
to
the
ui
thread,
and
so
you
have
to
do
like
a
dispatcher.invoke
and
all
this
stuff.
You
know
I
don't
have
time
for
that,
so
there's
actually
an
easier
way.
B
We
can
do
it
when
we're
using
task
now,
if
you
would
like
to
do
the
dispatcher.invoke,
it
will
actually
work
in
this
scenario,
but
I
would
say
let
let
the
task
parallel
library
do
this
for
you,
because
it's
a
lot
easier
and
for
this,
what
we're
going
to
do
is
we're
just
going
to
look
at
another
one
of
these
overloads
on
continue
with,
and
in
fact
I
feel
like
eight
number.
Eight
is
a
really
good
one
that
we
should
look
at
so
we'll
look
at
number.
Eight,
hey
look
at
that.
B
So
for
overload
number
eight
in
addition
to
the
action
of
task
as
a
parameter.
It
also
takes
a
task
scheduler
as
a
parameter
now
the
test,
the
task
scheduler,
is
the
object,
that's
responsible
for
managing
all
of
the
tasks.
So
it's
basically
looking
at
the
tasks
that
have
been
created
and
says:
okay,
is:
is
this
one
ready
to
run,
or
is
it
waiting
for
something
else
to
complete?
Okay,
this
one's
ready
to
run?
What
should
I
do
with
it?
Okay,
let
me
grab
a
thread
from
the
thread
pool
and
put
it
on
it.
B
It's
it's
the
thing,
that's
handling!
All
of
that,
so
that's
what
the
task
scheduler
is
responsible
for
now
there
is
a
magical
method
which
is
a
static
method
on
the
task
scheduler
class,
which
is
from
current
synchronization
context.
B
B
So
what
this
is
saying
from
current
synchronization
context
is
saying
you
know
what
for
this
continuation.
I
would
like
you
to
run
this
in
the
same
context
as
where
this
continuous
method
is
being
called.
So,
for
example,
in
this
case,
I'm
being
run
inside
a
button,
click
event
handler,
which
is
on
the
ui
thread.
B
So
when
I
say
from
current
synchronization
context,
I'm
saying
to
run
this
continuation
go
back
to
the
ui
thread
and
that's
not
the
default
behavior
for
task,
and
so
basically
what
happens
is
if
you
don't
tell
it
otherwise,
the
task
scheduler
says:
oh
okay,
I'm
running
running,
I'm
done
running
this
get
async
method.
What
do
I
have
to
do?
Next?
Oh,
wait.
There's
a
continuation!
I'm
supposed
to
run
this
populate
list
box
method.
Where
should
I
run
that?
B
Oh
you
know
what
I've
got
this
thread
that
I
was
just
using,
I'm
just
going
to
keep
using
it
so
kind
of
by
default.
It
keeps
running
on
the
same,
not
ui
thread
that
it
was
using
before
so.
If
we
want
to
go
back
to
the
ui
thread
in
this
case,
we
specifically
have
to
tell
it
hey.
You
know
what
go
back
to
this:
the
current
synchronization
context
to
do
this,
and
so
now,
if
we
do
this
and
run
our
application
and
click
on
the
button.
B
Data-
oh,
that
was
a
really
long
way
to
get
in
here.
Okay
now,
the
next
question
is:
is
it
asynchronous?
Now
I
will
say
this
is
not
very
impressive.
Over
a
screen
share,
it's
much
more
impressive
in
person,
because
the
screen
share
will
be
jaggy
but
watch
this,
so
I'm
going
to
click
on
the
button
and
then
I'm
going
to
move
the
window.
Do
you
see
that?
B
I
am
actually
showing
that
this
is
happening
on
a
separate
thread,
not
the
ui
thread,
and
so
my
ui
stays
responsive,
and
this
is
something
that
I
found
so
valuable
because
I
did
corporate
development
for
many
many
years
and
built
line
of
business
applications
and
they
were
mostly
desktop
applications
and
a
lot
of
times.
What
we'd
have
is
like
some
report
that
would
take
forever
to
run,
and
so
what
would
happen?
B
B
B
Now
there
are
interesting
issues
with
that,
because
we
still
need
to
let
the
user
know
hey
that
report
that
you
asked
for
it
is
running,
so
I
actually
put
up
a
little
clock
timer
for
one
of
my
users,
and
so
they
could
see
the
clock
ticking
and
as
long
as
they
saw
the
clock
ticking,
they
felt
sure
that
it
would
come
back
someday.
B
So
our
code
works
and
it's
asynchronous,
but
this
is
not
code
that
you
will
see
in
any
examples
at
all
online,
because
it's
not
cool
enough
because
it
doesn't
use
lambda
expressions
now.
Lambda
expressions
are
another
thing
that
I
enjoy.
I
don't
know
if
the
choice
the
right
word,
I
think
they're
important
for
people
to
learn
and
that's
because
ninety
percent
of
the
examples
online
use
lambda
expressions
where
they
could
use
a
separate
method,
and
that's
because
that's
what
the
cool
kids
do.
B
So,
even
if
you
don't
use
lambda
expressions
yourself,
you
need
to
learn
them
so
that
you
can
understand
the
sample
code.
You
see
online
now
the
way
that
land
exam
expressions
are
mostly
used,
at
least
in
my
world
I'll
say,
is
as
an
anonymous
delegate
now.
What
we
have
here
is
known
as
a
named
delegate
and
it's
a
delegate,
because
if
you
remember
our
method
said
well,
I
need
an
action
of
something
and
an
action
is
a
built-in
delegatetype
and.net.
B
So
I
have
a
named
delegate
and
the
name
happens
to
be
populate
list
box
terminology
in
the
delegate.
World
gets
pretty
bad,
and
so
what
I'm
going?
To
do
is
I'm
going
to
take
this
named
delegate
and
turn
it
into
an
anonymous
delegate,
and
I
can
do
that
by
taking
the
method
body
or
I'm
sorry,
the
parameters
and
the
method
body,
I'm
going
to
highlight
those
and
copy
them
to
my
clipboard
and
then
up
here
where
I'm
using
this
populate
list
box.
B
B
And
so
what
I've
done
is
I've
created,
what's
known
as
an
anonymous
delegate
and
the
official
definition
for
an
anonymous
delegate
is
a
delegate
without
a
name
yeah.
I
love,
I
love
documentation,
so
it's
basically
inline
code.
Now
I
mentioned
that
a
lambda
expression
is
an
anonymous
delegate,
the
way
we're
going
to
use
it
here
and
so
that
kind
of
implies.
B
Now
I
realize
this
doesn't
look
like
a
lambda
expression,
because
it
is
still
quite
readable.
I
can
understand
what
it
is,
but
it
is
a
land
expression
and
lambda
expressions
because
they
were
they
came
out
at
the
same
time
as
link.
They
were
actually
added
to
the
language
because
of
link
language
integrated
query,
which
is
one
of
the
best
things
ever
added
to
c.
B
B
Now
I
would
recommend
you
write
down,
parameter
type
inference
just
because,
when
you
say
in
front
of
your
boss,
you
sound
really
smart.
Now.
What
parameter
type
inference
means
is
that
if
the
compiler
can
figure
out
the
type
of
the
parameter
for
the
lambda
expression,
I
do
not
have
to
type
it
in,
and
so,
if
I
hover
over
task,
I
can
see
this
is
still
strongly
typed.
It
knows
this
is
a
task
of
list,
a
person,
and
how
does
it
know
that?
B
Now.
Another
thing
with
lambdaexpressions
is:
if
you
only
have
one
parameter,
you
do
not
need
parentheses
around
it
and
then
by
convention
a
lot
of
people
will
use
single
character,
parameter
names
for
lambda
expressions.
I
generally
don't
do
that
for
multi-line
bodies.
If
I
have
a
single
line,
then
I'll
often
do
that,
but
I.
B
And
so
now
that
looks
a
lot
more
like
a
lambda
expression
that
we
would
typically
see,
but
it's
the
same
thing.
So
this
is
a
method
that
takes
a
task
of
list,
a
person
as
a
parameter
returns
void,
and
then,
if
we
run
the
application,
we'll
see
that
this
still
works
the
same
way,
and
I
know
we've
known
each
other
for
all
of
45
what
15?
What
what
time
is
it
wow?
Okay,
45
minutes?
B
B
B
I
have
the
action
right
action
of
task
of
list
a
person,
so
I
need
to
understand
delegates
really
well.
I
probably
need
to
understand
lambda
expressions,
because
that's
what
all
the
examples
are
going
to
be
and
then
I
don't
want
to
even
start
on
this
from
current
synchronization
context.
Where
would
I
even
find
that
right?
B
So
it's
not
exactly
a
beginner
level
thing
now,
like
I
mentioned
task,
is
very
very
powerful,
but
it
turns
out
that
doing
kind
of
this
action
right
here
is
what
a
lot
of
people
have
to
do:
95
percent
of
the
time
in
my
world,
where
I'm
basically
you
know,
writing
a
corporate
line
of
business
applications
that
I
did
for
many
years.
B
I'm
not
doing
that
anymore,
but
you
know
I
spent
11
years
writing
corporate
apps.
You
know
it
would
be
okay.
I
want
to
kick
off
this
process
and
get
a
result
back.
That's
basically
what
I
want
to
do
and
because
of
that
and
the
complications
when
dot
net
4.5
came
out,
our
language
designers
for
c-sharp
said:
let's
make
this
95
option
a
lot
easier
and
that's
actually
where
we
got
async
await
from
now.
When
we
talk
about
what
async
await,
is
it's
really
a
syntactic
wrapper
around
task?
B
Now
I
will
put
a
little
asterisk
next
to
that,
because
since
then
it's
been
extended
a
little
bit.
You
can't
actually
await
things
that
aren't
tasks,
but
I'm
not
going
to
talk
about
those
this
evening,
but
it's
the
way
we'll
use
it
tonight
and
probably
the
way
you're
mostly
using
it,
is
as
a
syntactic
wrapper
around
task
and
what
it
does.
Is
it
basically
pauses
the
current
method
until
the
task
is
done,
okay
and
then
from
there,
when
we
do
that,
we
just
kind
of
write
code.
B
The
way
we
normally
would,
and
so
we
would
expect
it
to
be
a
blocking
operation
where
we
say
oh
well.
If
I
stop
here
for
three
seconds,
that's
going
to
hang
the
thread,
because
this
is
you
know
all
one
thing,
but
it's
not
and
that's
what's
really
cool
about
it,
because
it
looks
like
the
normal
code
we're
used
to
writing.
It
looks
like
a
blocking
operation,
but
it
does
not
block
the
current
thread
and
that's
really
cool.
B
Now,
when
we
talk
about
what
async
is,
async
is
really
just
a
hint,
and
hint
is
probably
not
a
strong
enough
word,
but
the
async
modifier
tells
the
compiler
hey.
You
know
what
a
weight
is
going
to
be
used
in
this
special
way
here
and
the
primary
reason
for
that
is
because
a
weight
was
not
a
reserved
word
in
c
sharp,
so
you
technically
could
have
had
something
in
your
code.
Already
that
was
named
quote
await
and
so
to
avoid
accidentally
breaking
code,
even
though,
probably
not
real
likely.
B
They
said,
you
know
what
we're
going
to
have
this
async
modifier
that
we
can
put
on
a
method
and
adding
async
to
a
method
does
not
magically
make
it
asynchronous,
but
what
it
does
do
is
it
tells
the
compiler
if
you
find
the
word
await
inside
this
block
of
code,
I
want
to
use.
I
want
you
to
use
it
in
this
special
way.
So
that's
really
what
async
is.
B
B
B
So
what
this
first
option
is
saying
is:
okay,
well,
I'm
going
to
add
the
async
modifier
and
then
I'm
going
to
change
it
from
void
to
task.
Now,
I'm
not
I'll,
be
talking
a
little
bit
about
why
we
don't
like
async
void
methods
once
we
get
to
exception
handling
so
generally,
a
best
practice
is
to
say:
oh,
I
want
to
return
a
task.
Even
if
I'm
not
getting
something
back
and
then
the
other
thing
it's
going
to
suggest
is
renaming
this
method
to
put
an
async
at
the
end
of
it.
B
So
the
easiest
way
is
to
just
type
in
async
yourself,
if
you're
inside
an
event
handler,
so
just
as
a
heads
up
as
far
as
what
that
will
do,
the
second
one,
but
it
will
still
want
to
rename
the
method
and
again,
if
the
rename
isn't
put
in
the
place
where
it's
hooked
up
in
the
xaml.
In
this
case,
then
that
would
also
basically
unhook
my
event
handler
okay.
Now,
what
do
I
have?
Okay?
B
B
B
This
really
doesn't
feel
like
enough
code,
but
we're
gonna
try
it.
So
let's
go
ahead
and
just
run
this
and
see
what
happens.
Okay,
so
we'll
click
on
the
fetch
with
a
wait
button
and
we'll
wait
three
seconds
and
then
oh
there's
data,
okay,
that's
cool!
Is
it
asynchronous
again
I'll?
Do
my
little
janky
hey
look
at
that,
I
can
still
interact
with
the
ui,
so
it
is
asynchronous
wow
I
like
that.
That
is
really
cool.
B
B
If
I'm
normally
going
through
a
method
like
this,
I
would
not
expect
line
35
to
run
on
a
different
thread
than
line
37.,
so
the
people
who
built
this
said
people
are
going
to
expect
this
to
be
on
the
same
thread,
so
that
from
current
synchronization
context
is
the
default
when
you're
using
a
weight
and
that's
exactly
what
I
need
here
now
it
might
not
be,
and
so
something
that
you
hear
often
when
people
are
talking
about
awaiting
methods
is
that
you
should
use
this
configure
await
false.
B
This
is
a
best
practice.
Use
configure
weight,
false
use,
configure
weight,
false
use,
configure
right
faults.
You
really
should
be
using
configure
weight
false
well.
What
does
that
do?
It
puts
it
back
to
the
same
way
that
task
does
it.
So
if
we
run
the
application
at
this
point,
then
what
we'll
see
is,
after
our
three
seconds,
we'll
see
that
we
get
the
same
exception
that
we
saw
earlier.
B
B
Now,
when
I
say
a
little
bit
more
performant,
if
you're
going
to
be
doing
this
a
bazillion
times,
then
you're
going
to
see
some
benefit.
If
you
do
it
twice,
you
probably
will
not
notice.
So
if
you're
doing
library
code
on
a
server
and
configure
weight
false-
and
you
have
millions
of
requests-
you
will-
you
might
see
a
visible
difference-
I
honestly
don't
know
because
I
haven't-
I
haven't
done
any
performance
testing
on
this,
but
basically
it's
saying
if
we
don't
use
that,
then
it
does
that
from
current
synchronization
context.
B
So
there
is
some
overhead
where
it
says
you
know
what
I
need
to
get.
I
need
to
grab
the
context
and
hang
on
to
it
so
that
I
can
get
back
to
it.
When
I'm
done,
if
you
say
configure
away
false,
that
process
doesn't
happen,
it
doesn't
grab
the
current
context.
It
doesn't
worry
about
getting
back
to
it.
It's
just
like
okay.
What's
the
easiest
thing
to
do
right
now?
Oh
you
know
what
I
have
this
thread
that
I've
been
using.
I'm
gonna
keep
using
it.
That's
the
easiest
thing
for
me
to
do
so.
B
B
It
might
be
hit
and
miss,
for
example,
if
you're
doing
some
more
old
school
web
development,
where
you're
using
things
that
are
in
the
session,
for
example,
the
session
is
tied
to
a
thread.
So
if
you
need
session
information,
you
kind
of
need
to
go
back
to
where
you
were
so.
You
can
read
that
session
information.
B
Okay,
so
I've
showed
how
we
can
kick
off
an
asynchronous
process,
get
the
result.
Stick
it
into
a
list
box
with
both
tasks
and
with
a
wait,
and
I've
been
talking
a
really
long
time
really
quickly.
So
I
would
like
to
pause
for
a
second
before
I
go
on
to
the
next
thing
and
let's
see,
if
there's
any
questions
on
what
we've
looked
at
so
far,.
B
Oh,
look
at
that,
so
we've
seen
results
and
configure
weight
false.
Yes,
I
we've
looked
at
both
of
those
and
if
you've
got
any
follow-up
on
that
question,
I
would
be
glad
to
talk
some
more
about
those,
because
those
are
things
that
people
ask
about
all
the
time.
B
Okay,
well
I'll
keep
an
eye
on
the
chat
window
and
also
feel
free
to
barge
in
on
your
microphone.
If
you'd
like,
I
am
going
to
move
on
and
say,
oh
wait.
Actually
before
I
move
on,
I
was
going
to
talk
about
exception
handling,
but
before
I
talk
about
exception
handling,
I
really
need
to
talk
about
a
ui
issue
that
we
have
with
our
application.
B
That's
interesting.
Does
this
do
the
same
thing?
B
Yep,
it
sure
does?
Okay,
that's
fun.
Let's
look
at
our
await
method,
since
this
is
a
little
bit
more
like
normal
coding
and
see
if
we
can
figure
out
what's
going
on.
It's
like
okay,
so
my
first
instinct
is
jeremy
you're,
an
idiot
you're,
not
clearing
the
list
box,
but
as
we
can
see
on
line
35,
we
are
in
fact
clearing
the
list
box
and
what's
happening,
is
the
joy
of
asynchronous
programming?
B
B
Oh,
it
really
needs
to
go
after
line
36,
but
then
you
don't
clear
it
at
the
beginning.
Oh
maybe
before
and
after
oh
wait.
However,
you
try
to
put
in
this
clear
list
box.
You
will
run
into
weirdness
in
the
ui
and
the
bigger
problem
is
which
data
do
we
want
the
person
to
see?
B
B
That
would
be
better
and
I'll
set
it
to
true
down
at
the
bottom.
So,
rather
than
trying
to
figure
out.
Where
am
I
supposed
to
clear
the
list
box?
I'm
just
going
to
make
it
so
you
can't
click
the
button
multiple
times.
Hey!
Look
at
that!
It's
disabled!
I
can't
click.
It
when
the
data
comes
back,
it
re-enables.
B
Don't
overthink
this
because
my
first
tendency
is
to
overthink
this,
oh
no.
I
have
to
figure
out
where
to
put
clear
list
bot.
No,
I
need
to
fix
my
ui,
so
the
user
can't
enter
an
invalid
state.
So
these
are
the
things
I
think
about
now.
What
happens
if
I
get
an
exception
somewhere
in
this
block
of
code?
Well,
my
button
would
just
stay
disabled.
B
B
So
I'm
going
to
use
the
keyboard
shortcut,
ctrl,
k,
control
s
and
that's
the
shortcut
for
surround
with
snippet,
and
this
has
a
set
of
code
snippets
that
have
the
concept
of
a
body
to
them,
and
in
this
case
I
can
type
in
tri-f,
which
represents
a
try,
finally
block
I
hit
enter.
It
takes
the
block
of
code
that
I
had
highlighted
it
wraps
it
in
a
try.
Block
gives
me
a
finally
block
puts
my
cursor
there,
so
I
can
start
typing.
This
is
like
lazy
developer
for
the
win
scenario
here.
B
Okay,
so
there's
a
question
of:
what's
the
best
practice
to
handle
multiple
async
functions,
I
will
come
back
to
that
at
the
end.
Is
that
okay?
Well,
it's
gonna
have
to
be
okay,
because
that's
what
I'll
do
I'll
I'll
get
through
the
rest
of
this,
and
then
we
can
take
a
look
at
when
you
need
to
step
outside
the
box,
because
what
we're
seeing
with
this
await
is
that
it
gives
me
that
95
right
most
of
the
time,
here's
what
I
want
to
do
make
an
asynchronous
call
get
data
back
from
it.
B
B
If
I
use
a
weight,
it'll
it'll
run
those
in
sequence.
If
I
want
to
run
them
in
parallel
now,
I
have
to
step
outside
of
the
await
box
and
do
something
else
so
and
that's
something
I
love
to
play
with
too.
I
have
another
talk
that
I
do
about
parallel
programming,
which
is
really
cool.
B
B
B
So
let's
click
the
button
again
and
just
kind
of
step
through
this
code.
So
I
step
and
I
disable
the
button.
Then
I
clear
the
list
box.
Then
I
kick
off
the
get
async
method
and
then
notice.
This
whole
block
with
the
continuous
is
highlighted.
This
is
me
setting
up
the
continuation.
This
isn't
the
inside
of
the
continuation
running.
It's
me
setting
up
the
continuation
and
then
my
code
keeps
running
so
I
hit
this
block
that
re-enables
the
button
and
then
I
exit
the
method.
B
So
really,
what
we
need
to
do
is
not
re-enable
the
button
down
here
at
the
bottom
of
our
event
handler,
but
do
it
inside
of
the
continuation.
B
So
after
the
data's
come
back
and
we've
dealt
with
it,
then
that's
where
we
want
to
re-enable
the
button
and
then
we'll
see
that
this
operates
as
we
would
expect
so
click
the
button.
Now
it's
disabled.
I
can't
click
it
again
when
the
data
comes
back
the
button
re-enables
now
in
this
case
I
could
deal
with
okay.
What
happens
if
we
get
an
exception
in
this
block
of
code?
B
B
B
Now,
when
you're
talking
about
multi-threading
and
exceptions,
things
are
pretty
fun
and
I
use
fun
in
the
worst
connotation
of
the
word,
because,
generally,
what
happens
is
if
we
have
an
exception
or
I'll
I'll
put
it.
This
way,
an
exception
will
stay
on
its
own
thread
unless
we
go
looking
for
it-
and
I
can
prove
that
right
here,
because
let's
comment
out
the
block
of
code
that
checks
the
result.
Okay,
so
I'm
not
checking
the
result,
I'm
not
populating
the
list
box
inside
the
continuation,
I'm
just
going
to
re-enable
the
button.
B
Now,
if
I
run
this
and
then
click
the
button
wait
the
three
seconds,
then
what
we'll
see
is
that
the
button
re-enables,
so
we
don't
actually
see
the
exception
that
happened
in
that
asynchronous
method
because
we're
not
looking
for
it
and
that's
the
default
of
how
threading
works
now.
The
reason
we
are
seeing
it
in
this
case
is
because
we're
trying
to
access
the
result
property
on
a
faulted
task.
B
B
B
B
B
B
B
Well,
let's
go
ahead
and
do
something
that
you
should
never
ever
ever
ever
do
to
your
users,
which
is
show
them
a
raw
exception,
so
just
for
demonstration
purposes,
only
I'm
going
to
do
a
message,
box,
dot,
show
and
we'll
say,
error,
error,
error
and
then
we'll
put,
in
the
exception,
the
type
of
the
exception.
Okay.
How
do
we
get
to
that?
Well.
Task
has
an
exception
property
on
it,
which
is
populated
if
the
task
is
in
a
faulted
state.
B
Now
again,
I
will
say:
don't
do
this
to
your
users,
because
raw
exception
messages
are
not
good
for
users,
but
what
I'm
showing
you
is
how
to
get
to
the
exception
so
that
you
can
stick
them
into
your
your
logging
process
or,
however,
you
deal
with
exceptions
so
demonstration
purposes.
Only
now
one
thing
that
you'll
notice
is
that
my
I've
got
a
green
squiggly
under
task.exception
and
that's
because
I
have
the
non-nullable
reference
types
turned
on
in
my
project.
B
So
this
is
something
that
we
got
in
c
sharp,
eight
and
down
here
on
line
12,
you
can
see
I've
enabled
nullable.
It's
called
nullable
reference
types,
which
is
confusing
because
reference
types
are
normally
nullable.
If
you
enable
nullable
reference
types,
then
reference
types
are
not
nullable.
Unless
you
say
they
are
so
terminology
is
really
confusing.
B
But
basically
it's
saying
hey.
You
know
what
this
exception.
Property
might
be
null
and
if
you
access
something,
that's
null.
That's
really
bad.
Now,
what's
good
about
this
nullable
reference
types
I'll
say
process
is
that
if
I
actually
do
a
check
to
say
exception
is
not
null
here
inside
the.
If
block
those
green
squigglies
go
away,
because
it's
smart
enough
to
say
oh
well,
you're
checking
to
see
if
it's
null,
so
it's
obviously
not
null
here.
So
I'm
going
to
let
that
go.
B
B
B
So
that's
what
that
operator
is
for
I
I
kind
of
stick
things
like
that
into
my
demos,
just
so
that
we
can
see
so
many
language
features
get
added
to
c
sharp.
So
I
try
to
make
them
a
little
bit
useful.
B
B
So
the
next
question
I
have
is:
why
am
I
in
this
block
of
code?
Well,
it's
because
is
completed,
does
not
mean
completed
successfully.
It
just
means
no
longer
running
now.
The
reason
I'm
showing
you
this
specifically
is
because
you
might
have
noticed
when
I
was
looking
at
the
options
for
task
there
is
and
is
completed
successfully,
which
is
very
obviously
what
I
want
here.
B
It
is
not
in
any
version
of
net
framework.
So
when
I
started
doing
this,
with
net
framework
I
tried
to
use
is
completed
and
it's
like.
Okay,
that's
not
that
doesn't
mean
completed
successfully.
Just
means
no
longer
running
so
not
useful
in
this
scenario.
B
Now,
if
you
are
in
the
net
framework
world,
you
do
have
options
because
task
also
has
a
status
property
and
the
status
property
is
an
enum
of
task
status
and
it
actually
has
a
rand
to
completion
option
and
there
is
also
a
faulted
and
a
created,
there's
a
cancelled
in
here
somewhere
as
well.
So
there's
yeah,
there's
cancel
so
it
has
all
of
the
states
that
a
task
can
be
in.
So
if
you
do
want
completed
successfully
and
you're
in
the
net
framework
world
check
the
test
status.
B
Now
I'm
kind
of
upset
that
they
didn't
take
the
is
completed
successfully
and
back
port
it
to
net
framework.
Because
to
me,
that's
a
no-brainer,
because
that's
a
calculated
property
checking
the
status,
so
there
might
be
performance
issues.
I
don't
know
why
they
didn't,
but
it
kind
of
upsets
me
that
it's
not
in.net
framework.
B
It
kind
of
upsets
me
that
it
wasn't
in
net
framework
to
begin
with,
but
that's
as
far
as
I'm
going
to
go
with
there.
Okay,
so
let's
go
back
to
this
aggregate
exception.
Okay,
what
is
an
aggregate
exception?
B
B
B
Okay,
great.
How
do
we
get
to
the
real
exception?
Okay?
Well,
I
could
say
task.exception.interexceptions
right,
that's
kind
of
a
standard
thing
that
we
all
do.
Unfortunately,
inner
exceptions
is
also
potentially
aggregate
exceptions
and
so,
depending
on
what
your
situation
is,
it
could
be
aggregate
exceptions
all
the
way
down
yeah.
Now
what
because
I
don't
know
the
stuff
I'm
calling.
Maybe
it
is
kicking
off
seven
child
tests
that
run
in
parallel.
I
don't
know
do
I
need
to
be
worried
about
this,
and
so
my
initial
tendency
is
like
oh
well.
B
I
need
to
come
up
with
some
kind
of
a
tree
parser
for
this,
so
that
I
can
get
down
to
the
real
exceptions
and
no
matter
what
it
gives
me.
I
can
figure
it
out
now
before
you
build
your
own
tree
parser,
I'm
going
to
show
you
a
magical
method
on
aggregate
exception
and
the
magical
method
is
known
as
flatten
and
what
it
will
do
is
it
will
take
the
tree
structure
and
go
and
make
a
single
level
of
inner
exceptions.
B
B
Don't
tell
me
how
I'm
not
going
to
tell
you
how
long
it
took
me
to
figure
this
out.
But
if
you
need
three
person
code,
I
might
have
it
somewhere.
Okay.
So
now
I'm
going
to
do
something.
You
really
should
not
do
to
your
users,
and
that
is
I'm
going
to
four
each
over
the
inner
exceptions
on
this.
So
for
each
exception,
in
the
flattened
inner
exceptions
and
kind
of
go
like
that,
then
we'll
say
ex
dot
get
type
and
then
you'll
notice.
B
I
have
the
the
same
thing
here
where
it's
like:
okay,
yes,
I
know
what
I'm
doing.
I
know
that's
not
null,
and
then
you
know
what
let's
go
ahead
and
add
the
message
as
well
ex
dot
message.
B
Okay,
now
the
bad
thing
about
for
eaching
through
this
is
potentially
I
could
have
five
or
six
exceptions,
and
so
my
users
would
get
pop-ups
for
each
one
of
these
messages.
Don't
do
this
to
your
user,
please
don't,
but
I
do
want
to
show
that
you
can
get
this
flattened
structure.
You
can
iterate
through
it
put
it
into
your
logging
structure
so
that
you
can
handle
them
and
feel
and
figure
out
what
you
need
to
do
to
your
application
to.
You
know
protect
against
these
particular
issues
that
come
up.
B
B
B
So
we'll
get
our
pop-up
okay
and
this
box
has
actually
changed.
I
will
say
in
the
not
too
distant
past
past,
so
you'll
notice
that
we
have
this
aggregate
exception
and
then
inside
there
is
an
inner
exception.
That's
noted
here.
This
has
not
implemented
exception
with
the
real
message.
Jeremy
did
not
implement
this,
so
showing
this
inner
exception
is
actually
something
that's
fairly
new
in
visual
studio,
so
the
tooling
keeps
getting
better.
B
Okay,
so
what
happens?
Is
it
stops
on
the
get
async
method,
which
is
exactly
where
we
would
expect
it
to
stop
in
normal
code
right,
non
I'll,
say,
synchronous,
code,
non-asynchronous
code
and
then
something
that's
really
interesting
is.
If
you
look
at
the
exception,
it's
showing
the
not
implemented
exception.
B
Wow
that
makes
life
so
much
easier.
So
when
you're
using
a
weight,
you
don't
have
to
deal
with
the
aggregate
exception
and
that's
because
generally
again,
when
we're
doing
this
await
it's
often
something
that's
just
doing
one
thing:
asynchronously,
you
don't
get
the
tree
structure
of
exceptions
back
so
it
says.
Oh,
you
know
what.
If
I
find
a
structure
that
has
one
exception
in
it,
I'm
going
to
unroll
it
for
you.
So
that's
really
cool
and
that's
something
again.
That's
built
into
how
a
weight
works,
so
the
defaults
for
weight
are
really
good.
B
B
B
And
we
just
treat
this
like
any
other
normal
code
that
we
would
use
so
again,
if
you
can,
if
you
don't
need
to
step.
Oh,
I
clicked
the
wrong
button
there.
If
you
stay
inside
of
the
await
box,
meaning
here's
the
little
piece
I
need
to
run
using
a
weight
is
awesome
because
again,
here
I
get
the
real
exception,
not
implemented
exception.
I
don't
have
to
unwrap
it
it's
just
there.
I
deal
with
it
with
a
try,
catch
finally
block,
and
so
you
can
see
my
finally
ran
and
the
the
button
re-enabled.
B
So
everything
just
kind
of
happens.
The
way
I
would
expect
it
to
so
definitely
definitely
a
weight
is
the
way
to
go
if
it
fits
into
your
world.
B
Okay,
so
I
have
one
more
thing
to
show
you,
and
that
is
dealing
with
cancellation
and
the
reason
I
show
this
is
because
I
ran
into
some
interesting
issues.
The
first
time
I
tried
this
a
lot
of
times.
I'm
talking
to
people
who
are
do
doing
mostly
web
development,
and
so
cancellation
doesn't
really
make
sense
in
that
world,
but
in
the
xamarin
world
it
might,
depending
on
what
you're
doing
so
yeah.
B
B
Now
the
reason
I'm
doing
this
is
so
that
I
can
have
a
default
cancellation
token,
so
my
current
methods
don't
pass
in
a
token,
which
means
we
don't
care
about
cancellation,
so
I
want
them
to
keep
working.
I
don't
want
to
force
them
to
pass
something
in
and
then,
if
I
just
create
a
cancellation
token
with
the
constructor
with
no
parameters,
it
will
create
a
token.
That's
in
the
not
cancellation
requested
state.
B
One
fun
thing
when
we're
talking
about
cancellation
cancellation
is
basically
a
flag,
so
a
cancellation
token.
Basically
there's
a
little.
Your
token
just
like
raises
its
hand
and
says
so,
if
you
care,
someone
would
like
to
cancel
this
operation
and
it's
really
up
to
the
calling
code
or
or
the
the
code
inside
of
this
method,
to
figure
out
how
it's
going
to
use
that
information.
B
Sometimes
we
can't
do
anything
about
it
if
I've
kicked
off
a
request
to
a
web
server
to
get
some
data
back.
I
really
can't
cancel
that
request,
because
it's
gone,
I'm
it's,
but
I
can
stop
waiting
for
it.
I
can
possibly
put
together
a
default
payload
to
get
back
to
my
users.
If
that's
the
scenario
I
want
so
there's
things
that
I
can
do,
even
if
I
can't
immediately
cancel
a
process.
B
Okay,
so
after
this
task.delay
we'll
check
the
cancellation
token.
Now
it's
really
tempting
to
say:
okay,
well,
cancellation
token
has
this:
is
cancellation
requested
property
on
it,
and
this
is
a
true
false
value.
So
I
could
look
at
this
and
say:
oh
well.
If
somebody
requests
cancellation,
then
I
can
deal
with
it.
B
The
problem
is,
I
don't
know
exactly
how
to
deal
with
this,
because
I
haven't
dug
into
task
that
deeply.
I
mean
I
know
I
need
to
set
the
is
cancelled
property
to
true.
I
know
I
need
to
set
the
is
faulted
property
to
false.
I
know
I
need
to
set
the
is
completed
successfully
property
to
false.
I
need
to
set
the
is
completed
property
to
true,
and
I
need
to
set
the
test
status
to
cancelled.
B
Don't
do
any
of
that
there's
a
method
on
the
cancellation
token
that
you
should
use
instead
and
a
lot
of
people
don't
like
to
use
this
method
because
it's
called
throw
if
cancellation
requested
the
reason
people
don't
like
to
use
this
method
is
because
it
has
the
word
throw
in
it
and
throw
implies
that
there's
an
exception
being
thrown
and
we
are
taught
as
a
as
a
good
practice
to
not
use
exceptions
for
flow
control.
B
B
Whenever
we
throw
an
exception,
it
has
to
unwind
the
call
stack
it
has
to
collect
all
the
information
it
has
to
start
bubbling
up.
That
call
stack
to
see
if
there's
an
exception
handler
somewhere,
there's
a
lot
of
things
that
happen
when
you
throw
an
exception,
and
because
of
that,
that's
why
we're
told
don't
use
exceptions
for
flow
control,
use
you.
A
B
A
better
if
statement
potentially
or
a
break
in
a
for
loop,
and
so
we
want
to
avoid
that
when
we
can,
because
exceptions
are
expensive.
B
Well,
in
this
case,
I'm
going
to
say
let
it
go,
because
if
we
throw,
if
we
call
this
method,
throw
of
cancellation
is
requested,
the
infrastructure
takes
care
of
everything
for
us,
so
make
sure
that
all
of
the
properties
are
set
appropriately.
It
makes
sure
that
the
exception
property
is
populated
appropriately.
It
takes
care
of
all
of
that
so
use
this
method.
If
you
would
like
to
stop
your
method
and
again,
this
is
a
flag.
B
But
in
the
meantime,
if,
for
example,
I
don't
click
the
button
until
you
know
we,
we
kick
off
the
call
to
the
web
server.
Well,
we're
we're
not
checking
for
cancellation
anywhere
else,
so
that
flag
will
basically
be
ignored
after
line
28..
B
So
if
we
haven't
said
it
by
line
28
we're
not
able
to
cancel
this
method
again,
it's
just
a
flag.
Now
we
could
check
the
cancellation
token
in
multiple
locations
on
this
method.
If
we
wanted
to,
but
I'm
not
going
to
do
that
today.
So
again,
it's
just
a
flag:
it's
not
an
abort.
It's
not
a
stop.
It's
not
a
halt.
It's
just
a
request.
B
So
let's
start
with
our
task
button
and
up
here
with
the
get
reader
async
again.
If
we
look
at
this,
I
have
a
cancellation
token
parameter
that
has
a
default
value,
so
I
don't
have
to
fill
it
in
if
I
don't
want
to,
but
let's
fill
it
in
with
a
hard-coded
token
just
to
see
if
we
can
get
things
working
so
we'll
do
a
new
cancellation
token
and
I'll
pass
in
true
to
the
constructor,
and
so
what
this
does
is
it
creates
a
cancellation
token
that
is
in
the
cancellation
requested
state.
So
it's
saying
hey.
B
B
Okay,
so
we
click
on
our
button.
We
wait
our
three
seconds
and
then
our
button
re-enables
nothing
else
happens,
and
that
is
exactly
what
we
expect,
because
inside
our
is
cancelled
block.
We
have
a
comment
that
says
deal
with
cancellation
here
and
then
again
down
on
line
43,
our
re-enabling.
The
button
is
outside
of
all
of
these,
and
so
in
this
case
we
can
just
do
a
message
box
and
we'll
just
say:
canceled
like
that.
B
Now
I
don't
like
to
silently
cancel,
especially
if
we're
in
a
situation
where
a
user
presses
a
button
or
even,
if
there's
a
timeout,
because
we
can
actually
use
cancellations
for
timeouts
in
certain
scenarios.
So
I
do
want
to
give
some
visual
clue
to
the
user,
probably
not
a
message
box,
because
those
are
the
most
annoying
things.
But
you
know
maybe
a
toast
message
are
those
still
cool.
B
So
we
could
see
that
that
was
pretty
straightforward
to
deal
with
we
already
kind
of
had
our.
If
else
statements
set
up,
let's
go
down
to
our
await
method
and
take
a
look
at
this
okay,
so
again,
we'll
just
hard
code,
a
cancellation
token
set
it
to
true
cancellation
requested
and
let's
just
run
this
and
see
what
happens
before.
We
do
anything
else.
B
B
Well,
remember
that
throw
of
cancellation
requested
it
actually
throws
an
exception
and
that's
good,
because,
let's
think
about
where
we
are
in
our
code,
okay,
so
we're
awaiting
this
get
async
method.
When
we
were
dealing
with
task
directly,
we
could
check.
We
could
check
the
is
canceled
property
or
we
could
check
the
canceled
status
on
the
task
itself.
B
Where
would
we
do
that
in
this
code?
There's
no
task!
The
task
is
completely
hidden
when
we're
using
a
weight.
So
again,
what
the
people
who
put
this
together
said
is
hey.
You
know
what
let's
incorporate
this
into
the
exception
handling
mechanism.
That's
already
in
place,
it's
familiar
to
the
people
that
are
writing
this
type
of
code
and
we'll
throw
an
operation
canceled
exception,
which
is
a
you
know,
special
exception,
which
means
I
can
catch
it
separately.
B
B
B
B
So
I
have
an
empty
button,
click
event
handler
and
so
I'll
try,
the
most
obvious
piece
of
code
I
can
think
of
which
is
I'll,
create
a
class
level
field,
which
is
a
cancellation
token,
we'll
call
it
cancel
token
and
we'll
new
up
a
cancellation
token
and
again
when
we
knew
it
up
like
this.
It's
in
the
not
cancellation,
requested
state,
and
then
I
can
pass
that
token
into
my
various
methods
and
then
down
here.
B
B
B
That
doesn't
sound
very
useful.
Does
it
now?
You
might
say:
oh,
look,
there's
this
is
cancel.
This
is
cancellation
requested
property?
Let's
set
that
nope.
If
we
look
at
it,
that's
a
read-only
property.
You
can't
set
it
okay.
I
won't
tell
you
how
long
it
took
me
to
figure
this
out,
but
I
would
recommend
reading
the
documentation,
if
you
ever
have
to
deal
with
this,
because
we
don't
want
to
manually
create
a
cancellation
token.
This
is
not
the
object
we
want
in
this
case.
B
B
So
if
we
go
back
down
to
our
cancel
button
method,
we
can
look
at
our
token
sources
properties
and
see
that
it
has
a
token
property
on
it.
Okay,
so
this
is
a
token
property
that
we
can
pass
to
our
to
get
async
method.
So
that's
great
even
better.
It
has
a
cancel
method.
Oh,
if
I
can
type
come
on,
it
has
a
cancel
method.
Hey
I
like
that.
B
It
also
has
a
cancel
after
method,
and
this
lets
you
put
in
either
a
number
of
milliseconds
or
a
time
span
to
say,
hey
once
this
time
passes,
go
ahead
and
cancel
this
so
we'll
just
we'll
just
set
this
cancel
token
to
true
I
I
know
some
people
have
used
this
for
timeouts,
I'm
I
still
kind
of
have
a
little
bit
of
trouble
using
it
as
a
timeout,
because
I
think
cancellation
and
timeouts
are
two
separate
things,
but
if
a
timeout
expires,
you
probably
want
to
say
I
don't
care
about
this
anymore
or
I
can't
keep
waiting
so
you
might
want
to
cancel
it.
B
So
it
kind
of
makes
sense
as
a
as
a
timeout
or
you
can
just
pass
a
random
value
to
it,
and
you
know
make
your
users
wonder
what's
going
on,
but
we'll
just
use
the
cancel
method
in
this
case.
Okay,
so
I
have
the
cancel
method:
let's
go
to
our
await
button
and
use
this
okay.
So,
instead
of
having
the
hard-coded
cancellation
token
in
the
get
async
method,
we'll
take
our
token
sources.
B
B
B
Okay,
I'm
just
going
to
click
the
button
and
wait
for
the
happy
path
to
go.
By
make
sure
I
didn't
break
that.
Okay,
it's
good!
The
happy
path
works.
Now,
let's
go
ahead
and
click
the
cancel
button.
Now
I
do
still
need
to
wait.
The
three
seconds,
because
again
we're
checking
the
cancellation
token
after
the
task.delay,
but
we
can
see
we
got
our
canceled
operation
here,
that's
great.
I.
B
Okay,
let's
do
the
same
thing
for
our
fetch
with
task,
and
this
will
be
basically
exactly
the
same,
so
we
will
pass
in
the
token
sources,
token
property
and
create
a
new
instance
at
the
top
of
this
method.
B
B
The
answer
is
absolutely
not
because
a
lot
of
the
methods
that
are
built
into
the
libraries
that
we
use
have
overloads
that
take
cancellation
tokens,
so
the
task.delay
method
takes
an
overload
that
takes
the
cancellation
token,
so
I
can
pass
it
to
that
method.
The
get
async
method
that
our
http
client
calls
has
an
overload.
That
takes
the
cancellation
token,
so
we
can
use
this
cancellation
token
in
various
methods.
B
So
in
this
case
we
won't
have
to
wait
for
that
delay
to
finish.
It'll
actually
cancel
the
delay.
So
this
is
something
that's
actually
pretty
pretty
neat,
so
we'll
click
on
the
button
and
then
I
click
cancel
the
pop-up
comes
up
right
away.
Click
on
the
button.
Click
cancel
the,
but
the
message
comes
up
right
away
so
and
then
just
out
of
a
cure.
B
Out
of
curiosity,
if
you
are
looking
at
the
exception
that
comes
back
with
a
weight,
the
message
is
different,
so
the
message
before
I
don't
remember,
I
think
it
says,
like
an
operation-
was
cancelled.
In
this
case
it
says
a
task
was
cancelled
because
that
task.delay
a
separate
thing
was
cancelled,
whereas
if
we
called
the
the
throw
of
cancellation
requested
method,
then
that
gave
us
a
different
message:
it's
still
the
same
exception
type.
So
that's
just
a
curiosity.
B
B
Okay,
so
I
I
need
to
stop
talking
a
little
bit
again.
So
I'm
going
to
pause
for
questions
nobody's
interrupted
me.
I
might
have
been
talking
too
quickly
and
not
leaving
space
for
people
to
interrupt
me.
So
if
that's
the
case,
I
apologize
but
keeping
an
eye
on
the
chat.
It
doesn't
look
like
people
have
been
pestering
me
there
either.
So
any
questions
at
this
point.
I've
got
a
couple.
A
B
That's
that's
really
the
goal
of
any
constructor,
so
it's
great
if
it's
like
well,
I
need
to
initialize
a
couple
fields
or
make
sure
something's
not
null
or
you
know,
put
in
some
default
values.
But
once
I
start
saying,
oh,
you
know
I
need
to
go.
Get
some
data
in
my
constructor,
that's
kind
of
where
we
fall
into
the
danger
world
because
we
don't
want
that
happening
when
we
call
new
on
something.
B
So
generally,
the
the
best
advice,
if
you
have
something
like
that
and
we
don't
always
have
control-
is
to
create
a
factory
method
or
something
that
can
be
called
as
initialization
code
later
on
those
aren't
great
either,
but,
for
example,
in
the
I'll
just
actually,
I
will
just
open
up
the
constructor
on
this
main
window
right.
B
This
has
an
initialized
component,
and
so
that
does
all
of
the
constructor
stuff.
But
you
can
also
hook
up
an
event
handler
that
says:
hey
when
this
is
done.
Initializing
run
my
code
and
that
runs
out.
You
know
the
event
gets
raised
inside
the
constructor,
but
then
anything
that
follows
on
with
that
runs
outside
of
the
constructor
and
so
that
way
you're
not
blocking
what's
going
on.
If
that
made
sense.
C
Crap,
this
dot.
D
B
This
right
now
wow
there's
a
lot
of
things
going
on
here
I
want
to
say
on
and
uninitialized
hey
look.
I
found
it
so
there's
actually
an
uninitialized.
This
is
an
event
yeah.
There
you
go,
so
you
can
hook
up
an
event
handler
to
this,
so
that
the
constructor
actually
exits.
But
then,
whatever
is
in
this
on
ish
uninitialized
event
handler
will
fire
after
the
creation
happens.
So
you
know
that
you're
in
this
case
your
form
is
there
and
the
xaml
has
already
been
processed
in
this
case.
B
So
then,
if
you
need
to
go
in
and
make
programmatic
modifications
to
the
form
or
add
things
to
it,
you
can
do
that
in
this
event.
Now,
obviously,
that
causes
issues
a
little
further
down
because
you're
like
well.
How
do
I
know
when
it's
really
ready
for
me
to
use?
B
And
that's
that's
something-
that's
a
little
more
difficult
to
answer.
So,
unfortunately,
I
don't
have
a
great
answer
to
that:
async
constructors.
I
know
that
comes
up
from
time
to
time
in,
like
the
language,
design,
discussions
and
usually
the
response
that
comes
back
from
the
language
team
is
yeah
that
that's
yeah.
We
don't
want
to
do
that
and
again.
These
are
people
that
have
that
know
why,
in
a
much
better
way
than
I
do
so,
yeah
async,
I
would
try
to
get
it
out
of
your
constructor.
B
If
you
can't
get
it
out
of
your
constructor,
then
basically,
you
could
kind
of
treat
this
uninitialized
if
you
use
task
manually.
So
if
I
use
task
manually,
there's
no
async
modifier,
so
I
don't
have
to
mark
it
as
async
and
there's
again
there
really
isn't
a
return
type
on
a
constructor.
Well,
the
object
itself,
so
you
could
actually
hook
up
a
continuation
inside
of
your
constructor
and
that
continuation
would
run
when
that
asynchronous
method
is
done.
B
A
Yeah
yeah,
no
that's
great
thanks
and
then
the
other
thing
I
had
a
question
on
which
you
you
touched
on
earlier
was
async
void.
You
know.
B
Yes,
so
now
that
we've
seen,
let
me
let
me
go
back
to
our
await
actually
either
one
of
these
okay.
So
when
we
have
an
async
void,
what
that
means
is
there's
no
task
coming
back
from
the
method
and
what
that
means
is.
We
cannot
await
the
method.
B
So
if
we
don't
have
a
task-
and
we
don't
have
an
await-
it's
truly
a
fire
and
forget.
So
if
you
have
an
async
void
method,
there's
no
way
to
know
if
it
completed
at
all
period.
B
There's
no
way
to
know.
If
you
got
an
exception
there's
you
basically
lose
complete
visibility
to
it.
So
if
you
do
have
a
true
fire
and
forget
scenario,
async
void
makes
sense
and
so
like.
If
I
have
an
operation
where
it's
like,
I've
got
a
data
stream
coming
in
and
if
not
all,
of
the
records
make
it
to
the
database.
B
That's
okay,
because
maybe
I'm
doing
diagnostics
on
a
piece
of
equipment
that
I
have
and
it
sends
out
a
hundred
thousand
records
every
second,
just
you
know:
here's
here's
the
status
of
all
my
my
different
things.
As
my
machine
is
running,
it's
probably
not
important
that
I
catch
all
of
those
records
it
might
be,
but
I
probably
want
to
make
sure
I
catch
a
vast
majority
of
them.
So
that
might
be
a
true
fire
and
forget
scenario.
Now,
if
something
happens,
and
I'm
no
longer
connected
to
where
I'm
storing
the
data.
B
Well,
I'm
not
getting.
Now
I'm
not
getting
anything
in
my
database,
and
I
have
no
way
to
see
that
so,
hopefully
you
might
want
some
monitoring
on
the
other
side
to
make
sure
you're
still
getting
stuff,
but
async
void
is
a
true
fire
and
forget
and
really
kind
of,
as
so
there's
kind
of
three
really
big
names
in
the
async
world.
B
Bring
my
website
over
so
I'll
show
you
how
to
get
there.
So
here's
my
website
and
again,
if
you
click
on
presentations,
you
can
see
here's
our
group
right
here.
If
you
click
on
presentations
this.
Oh
I'm,
sorry,
I'm
doing
a
talk
tomorrow
night,
so
I've
already
updated
my
website.
So
here
we
are
houston,
xamarin
users
group-
and
this
will
always
be
on
this
list.
It
will
scroll
down.
B
But
if
you
click
on
it
it
will
take
you
to
the
resources
and
part
of
these
resources,
and
you
can
see
I've
got
a
lot
of
stuff.
A
lot
of
blog
articles,
there's
a
youtube
series
and
there's
a
list
of
async
experts
down
here.
B
So
stephen
cleary
is
one
of
the
I'll
say
he.
He
has
several
books
that
are
published
on
async
topics,
the
I
think
it's
called
the.net
concurrency
cookbook
and
I
think,
there's
more
than
one
that
he
has,
but
he's
really
good.
As
I'm
a
developer
and
here's
the
things
I
need
to
do
with
async.
So
he's
really
good
at
that
stephen
tobe.
He
used
to
work
for
microsoft.
B
I
don't
believe
he
does
anymore,
but
he
knows
more.
The
internals
of
how
all
this
stuff
works
and
then
lucian
wischik,
who
unfortunately
no
longer
works
at
microsoft.
He
he
was
just
the
nicest
person
you
would
ever
meet
he's
the
one
who
actually
wrote
this
stuff
and
I'm
still
pretty
sure,
he's
the
only
one
on
the
planet
that
actually
understands
what's
going
on
underneath,
but
so
lucian
has
some
great
parallel
versus
concurrent
I'll,
say:
presentations
with
like
slides
and
video
and
demonstrations
that
show
okay.
B
If
you
have
an,
I
o
bound
operation,
meaning
you
know
maybe
file
system,
maybe
waiting
for
service.
You
want
to
do
concurrency
this
way.
If
you
have
a
cpu
bound
operation,
you
want
to
do
concurrency
this
way
and
if
you
mix
those
up,
you
actually
make
your
performance
worse.
So
he
has
a
lot
of
good
stuff
on
that,
anyway,
back
to
stephen
cleary,
who
has
written
a
lot
of
great
stuff,
I
actually
went
to
a
talk
that
he
did
on
async
and
he
had
a
slide.
B
So,
okay,
I
found
the
doctor
who
fan
so
that
was
his
slide.
So
and
steven
cleary
has
a
lot
of
great
articles
about
doing
sync
over
async
or
async
over
sync,
which
is
where
I
have
it
kind
of
like
the
constructor
right.
So
my
constructor
can't
be
asynchronous.
B
But
how
do
I
call
asynchronous
code
inside
that
and
that's
known
as
sync
over
async,
so
there's
async
on
the
inside
and
I'm
turning
it
into
something,
not
async,
and
he
talks
about
basically
the
the
issues
that
you
will
need
to
deal
with
in
those
scenarios,
so
he's
a
great
resource.
So
if
he
says
every
time
you
use
async
void,
rory
dies,
I'm
gonna
believe
that
again
in
the
ui
world
event,
handlers
are
definitely
an
exception
because
they
have
to
return
void.
B
B
But
if
you
do
async
main
you
have
to
change
the
return
type
to
task,
otherwise
it
won't
compile.
So,
even
if
you
do
an
async
main
it'll
say,
oh
main
has
to
return
a
task.
Otherwise
I
can't
do
this,
so
that's
kind
of
the
story
with
async
void.
If
I
had
an
async
void
method,
I
would
have
nothing
to
await
because
you
can't
get
data
back
out
of
an
async
void
method,
and
even
if
it's
I
don't
need
data
back.
I
just
need
to
do
something.
B
Asynchronously
like
write
code
to
a
log
or
write
a
message
to
a
log.
I
would
lose
visibility
on
whether
it
completed
successfully.
So
that's
why
async
void
is
considered
something
to
avoid
when
you
can.
A
All
right,
great
thanks
man.
Anyone
else
have
a
question
for.
B
B
So
when
we're
using
a
weight,
we
really
are
looking
at
a
one
at
a
time,
operation,
meaning
let's
say
I
called
this
method
three
times.
Let's
say
I
was
calling
three
different
services
right.
B
B
B
B
So
what
we
can
do
is,
let's
see
oh
yeah,
okay,
we'll
just
do
this
we'll
show
the
difference.
B
B
Yeah,
okay,
so
this
is
going
to
be
a
little
confusing.
What
I'm
doing
is
I'm
setting
up
two
different
continuations,
so
this
first
one
I'm
setting
up
a
continuation
that
will
populate
the
list
box,
our
standard
things,
and
then,
let's
do
one
instead
of
two
to
be
less
confusing,
and
so
now
I
have
a
continuation
on
the
second
half.
You
know
what,
let's
do
all
three,
just
just
for
just
for
the
wow
factor,
right.
D
B
B
Pretend
that
that's
okay,
and
so
now,
when
I
click
the
button,
I'm
only
still
going
to
wait
those
three
seconds.
So
I
got
all
of
that
data
back.
Let
me
do
it
again
maximized,
so
I'm
waiting
three
seconds,
I'm
not
waiting
nine
seconds,
because
all
three
of
those
tasks
are
actually
running
at
the
same
time.
B
So
that's
pretty
cool,
but
you
might
say
well
what,
if
I
don't
want
three
separate
continuations.
What
if
I
just
want
one
okay?
Well,
what
we
can
do
is
let
me
just
get
rid
of
these
extra
ones.
B
B
Don't
want
to
pollute
the
code
too
much
okay,
so
now
I
have
a
single
continuation
which
is
currently
on
our
person.task,
but
I'm
creating
all
three
of
these
tasks.
Well,
what
I
can
do
is,
I
can
set
up
a
another
call.
So
task
has
a
when
all
method
that
takes
an
array
of
tasks
or
an
innumerable
of
task.
B
So
what
this
means
is
that,
let's
just
create
just
so
it's
apparent,
let's
create
a
list
of
tasks.
C
And
tasks
new
list
of
tasks.
A
B
Continue
with
blah
blah
blah,
so
in
fact
yeah
I
can
do
yeah.
I
could
do
it
here,
oh
wait.
B
Not
to
actually
dot
that,
because
things
get
interesting
here,
because
what
this
is
is
this
is
a
single
task.
B
And
that's
what
doors
are
for,
so
what
this
does
is
it
gives
us
a
single
task
back
that
now
we
can
run
the
continuation
on
this
now.
The
problem
is:
is
that
this
continuation
doesn't
have
the
data.
That's
coming
back
from
these
other
tasks,
so
aggregating
the
data
gets
a
little
interesting,
but
this
is
kind
of
the
basic
thing
that
you
can
do
where
you
say:
okay,
I'm
going
to
create
separate
tasks
and
kick
these
all
off.
B
B
B
Oh
yeah,
here
we
go
so
I
have
another
complete
talk
which
is
about
parallel
programming
in
c
sharp,
and
this
is
really
kind
of
the
code
you'd
want
to
look
at
for
that
because
I
have
several
operations.
One
uses
a
parallel
four,
so
there's
actually
a
for
loop,
that's
built
in
where
you
can
see
console.
C
C
B
So
this
shows
using
a
parallel
four
and
actually
several
different
variations
of
it
since
it's
a
multi-level
grid
and
then
kind
of
the
one
that
I
I've
been.
I
think
it's
pretty
interesting
is
I
have
a
an
application
that
does
I'll
say,
discount
machine
learning
that
runs
code
in
parallel
and
the
way
that
I
do
this
is
I
end
up
creating.
C
B
Yeah,
okay,
so
in
this
case
I
have
a
for
each
loop,
because
I
want
to
process
in
this
case
let's
say:
400
images,
so
I
have
a
I'll
loop
over
each
one
of
these
images
and
I'll
create
a
new
task
using
task.run,
and
this
is
a
more
explicit
way
of
creating
a
task.
If
I
don't
have
a
method
that
returns
me
a
task.
B
D
B
So
continuous
is
expensive
to
do.
Would
it
be
better
to
use
two
awaits
or
not
really
so,
if
you're
doing.
B
It
all
basically
compiles
down
to
the
same
thing,
so
there
are
some
other
things
that
you
can
do
with
continuations,
which
I
have
some
articles
on.
B
Let's
see,
can
we
do
it
down
here
easily,
so
the
task
continuation
options,
for
example
here
in
this
little
pop-up
it
says
you
can
say
only
on
cancelled,
so
you
can
actually
set
up
separate
continuations
that
only
run
at
certain
times.
So
I
could
have
a
continuation
that
only
runs
if
the
task
is
cancelled.
I
can
have
a
separate
continuation
that
only
runs
if
the
task
is
faulted.
B
I
can
have
another
continuation
that
only
runs
if
the
completes
successfully,
so
these
are
actually
separate
methods
that
won't
run
unless
a
certain
state
is
hit
and
there
really
isn't
an
overhead
per
se
with
that.
It's
basically
just
setting
up
a
scenario,
because
really
what
happens
if
you
dig
into
it
is
the
compiler
builds
a
state
machine,
and
I
can't
I
don't
actually
can't
go
into
the
details
of
the
state
machine
because
I
don't
know
them,
but
the
compiler
actually
builds
a
state
machine
as
far
as
like.
B
Okay,
it's
in
the
state,
the
state,
the
state.
What
is
going
to
happen
next,
and
so
as
far
as
overhead,
I
really
don't
think,
there's
a
whole
lot
of
difference
between
a
weight
and
task
if
you're
and
continue
with,
if
you're,
just
kind
of
doing
the
basic
stuff,
because
it
kind
of
all
turns
into
the
same
thing
underneath
once
you
get
again
kind
of
once,
you
get
more
detailed
as
far
as
well
there's
a
lot
of
options
or
branches
or
multiple
tasks
running
at
the
same
time.
B
That
obviously
gets
a
lot
more
complicated
and
there's
things
you
can't
even
do
with
a
weight
so,
but
it
is
very
common
if
you
have
things
that
need
to
run
in
sequence
to
just
say,
okay,
I
need
to
await
this.
I
need
to
await
getting
all
of
the
prices
from
the
catalog
and
then
I
need
to
await
getting
a
total
from
the
order
that
needs
all
of
the
prices
from
the
catalog
and
then
I
need
to
await
this
other
process
that
might
be
doing
something
else,
so
these
actually
need
to
run
in
sequence.
B
They
cannot
run
at
the
same
time,
so
it's
very
common
to
have
multiple
awaits
inside
of
a
method.
In
fact,
the
this
person
reader
does
there's
an
await
on
the
get
async
for
the
client,
and
this
is
actually
getting
the
data
from
the
web
service
and
then
there's
actually
an
await
on
reading
the
strings
from
the
response.
B
B
A
All
right.
I
will
I'll
when
I
figure
out
how
to
get
the
video
from
zoom
I'll
post
that
and
share
the
link
with
everyone,
and
when
we
decide
what
we're
going
to
do
next
month,
I
will
post
that
on
meetup.
A
In
the
meantime,
everyone
have
a
great
rest
of
your
summer
and
stay
safe
thanks
again,
jeremy
yeah.
Thank
you.