►
From YouTube: .NET Core Design Reviews: System.IO.Pipelines
Description
We'll take a look at the new pipeline APIs David Fowler has created for use in ASP.NET Core.
For notes, take a look https://github.com/dotnet/apireviews/tree/master/2017/07-11-System.IO.Pipelines.
C
B
C
B
B
B
That
shows
some
consumption.
Okay,
so
maybe
put
the
the
API
side
by
side
with
a
sample.
So
we
can
look
at
the
types
and
sounds
like
your
PIN
thing.
So
the
first
thing
is
Darth
is
the
I
pipe
factory?
It's
Argus
the
pipe
battery.
That's
when
I
see
career
pipe.
B
I
love,
ya,
I
guess
I
should
so
a
pipe
is
basically
think
of
it,
like
a
a
channel
right
sold
just
twice
to
a
pipe
there's
and
there
is
someone
that
by
right,
there's
some
that
reads
alright.
So
today,
if
you
look
at
like
a
stream,
that's
juice
kind
of
it's
kind
of
an
obstruction
that
you
kind
of
implement.
Reading
right
in
this
type
model,
you
create
a
pipe
Somerset's
in
Minnesota
kind
of
the
basic
vertebrae,
the
pipe
itself
odd
memory.
B
So
when
you
call
read
your
seat
pocket
buffer,
you
don't
pass
in
one
when
you,
when
you
wanna
write
a
buffer.
It's
the
same
thing
applies.
You
actually
allocated
data
from
the
piper,
so
you
say:
cranium
pipe
LTS,
these
things
in
the
pipe
and
you
call
it
right
and
then
the
reader
gets
data
whenever
the
printer
press
it
to
the
actual
pipe,
that's
kind
of
the
bid,
the
basic
verdict
so
and
types
to
get
a
pipe.
You
use
a
pipe
artery.
B
So
the
reason
for
having
this,
rather
than
just
do
it
up
this
for
the
pool
pitbull
yeah,
so
my
project
is
kind
of
the
route
through
the
universe.
So
this
guy's,
like
the
pool
or
whatever
it
has
you
call
clay
pipe.
This
guy
gives
you
an
I
pipe
back,
which
has
our
reader
and
writer
and
those
guys
kind
of
married
to
the
same
the
same
like
inner
structure.
So
when
you
call
right
on
the
right
side,
we
really
can
be
seen
a
bit
so.
C
B
You
can
I
pipe
back
today,
this
an
abstraction,
it's
not
the
concrete
implication
and
that
pipe
could
be
implemented
with
any
any
kind
of
thing.
We
could
expose
pipe
and
have
you
pass
in
the
pool
directly,
but
it
takes
a
bunch
of
parameters
so.
B
So
yes,
in
the
beginning,
we
had
idea
because
then
you
kidding
you
up,
but
we
kind
of
end
up
with
a
pocket
because
it
can
make
kind
of
married
to
the
hole
bump.
Originally
it
was
like
toss
hatchery
create
toss.
This
isn't
like
a
peipus
is
there's
nothing
that
makes
italy
require
tip
to
dia
yeah
yeah.
So
what
is
a
five?
An
interface?
C
B
It
could
be
nunchakus
classes,
there's
no
there's
no
reason
it
has
me
in
place.
One
benefit
is
that
you
can
actually
implement
one
on
at
the
scene
type
if
you
want
to
decorate
a
pipe.
So
if
you
had
a
type
that
was
like,
if
you
had
a
stream,
let's
say
I
had
foo
foo
stream.
B
B
Thought
our
thank
you
thing
yeah.
So
how
does
this
relate
to
those
pipes?
Doesn't
well
it's
a
fun
name.
Why
isn't
this
for
pipeline?
So
the
so
the
reason
I
change
the
name,
because
it
makes
more
sense.
So
the
pipe
is
like
one
of
the
things
the
pipeline.
It's
like
a
bunch
of
pipes
chained
together.
So
if
you
had
like
no
one
other
guy
here,
you
could
do
this
right
right
really
see
below
this
pipeline,
and
this
is
this
is
the
pipeline,
but
individual
things
you
ready
to
reach
from
our
pipes.
B
The
first
name
is
channels,
then
there's
a
bingo
channels,
that's
kind
of
not
shifted,
I'm
kind
of
we're
for
worried
that
you
get
confused
channels.
There's
a
thing
called
pipes
that
ship
I
know,
but
the
thing
anywhere
else,
though,
the
other
day
I
barely
caught
fire.
We
had
rooms.
We
had
like
weird
like
rivers,
streams,
but
conceptually
it's
the
same
as
with
those
breaks.
Just
I,
don't
understand
how
you
how
you
explain
this.
That's
gonna,
be
one
of
the
very
first
questions
you
get.
Is
it
like?
We
have
pipes
yeah.
B
E
B
Like
a
data
flow,
then
look
at
it
took
a
bit
of
look
acting
Mary's
Lalo's
it.
Those
kind
of
things
if
you
guys
are
familiar,
even
tells
channels
the
prototype.
It
has
similar
concepts,
you
have
a
you,
create
a
channel
that
is
either
buffered
and
unbuffered
or
bounzer
nothing
on
bonded
and
it
has
an
in
and
an
output.
So
in
I
think
rights
are,
you
know
out
and
roots
are
in,
and
you
write
to
one
side
and
the
consumer
concerns
from
different
side,
and
you
can
pass
any
up.
B
Of
course,
that's
kind
of
the
main
idea
of
like
how
the
whole
thing
put
together
in
a
factory
you
get
a
pipe
back
and
you
read
and
write
Sims
look
at
this
sample.
The
sound
was
interesting,
so
this
entire
API
was
made
for
a
couple
of
reasons.
It
tries
to
simplify
common
things.
You
do
when
you
read
bytes
from
a
stream
and
I
also
try
to
minimize
allocations
per
read
and
per
right,
so
the
whole
goal
is
you
allocate
the
pipe
once
and
you
can
reuse
the
pipe,
but
every
culture
arena
right
does
minimal
allocations.
B
B
So
the
reason
yes
decorate
the
buffer
is
empty
and
resides
completed
is
because
the
writer
can
write
much
data
and
then
close
the
right
side
and
then
the
reading
will
be
consuming,
and
you
don't
want
to
finish
just
because
the
writer
said
I'm
done
see
so
to
drain
the
the
buffer
completely.
You
can
I
want
to
check
for
if
the
writer
is
done
and
if
the
buffer
is
empty
by
there
by
the
reader.
So.
C
B
C
B
B
B
B
So
whenever
a
recent
from
the
from
the
my
socket,
it
writes
to
the
applications
in
the
pipe
right,
so
the
transport
is
pretty
nifty,
actually
application
it
like
when
the
application
and
wants
to
write
it
is
the
socket
it
writes
to
the
applications
of
the
pipe.
So
kind
of
this
is
the
socket
owns
1/2
the
end,
the
pipe
on
one
half
of
it,
so
we
added
I
think
called
a
pipe
connection
to
represent
full-duplex
like
a
half-duplex
like
we
could
have
made
it
bi
pipe,
but
it
it's
the
same
interface.
B
C
D
B
Is
kind
of
its
kind
of
just
because
he
you
reduce
the
number
of
concepts
you
have
one
I
pipe.
The
only
thing
is
you
can
play
a
single
point
versus
two
ends
of
a
different.
You
can
admit
I
pipe
being
two
different
ends
of
the
same
leg:
I
think
they
need
to
be
different.
I,
agree
programs,
they're,
Samantha,.
B
B
One
I'll
get
so
far:
Oh
crazy,
alright
yeah
I
tried
to
contents
in
my
head,
which
is
actually
not
that
easy,
so
I
think
I
think
the
base,
if
you
ticularly
anything,
take
away
the
fact
that
is
a
you
can
write
out
that
interface
for
you
just
look
at
it.
Yeah
look
at
look
at
I.
Imagine
right!
Look
at
this
is
the
guy
first,
oh,
no,
no,
better
yeah!
They.
B
If
so,
I
pipe
has
reader/writer
kind
of
both
sides,
the
same
the
same
pipe
and
I
look
and
bind
output
and
they're
both
the
same
types
on
on
the
properties
but
they're
different
concepts,
so
that
makes
elicits
now
they
do
me.
That
seems
like
the
exactly
the
same
thing.
It
is
so
one
the
I
pipe.
If
I
write
to
the
writer
I
can
read
it
from
the
video.
This
is.
This
is
I
PI
yeah,
there's
the
graft
operation.
C
E
B
E
B
B
Chris
I
shouldn't
be
on
the
I
pipe.
To
be
honest,
it
should
be
on
the
implementation
she
shouldn't
be
on
the
abstraction
reset.
Is
there
because
of
reuse,
so
in
cash?
So
we
want
to
reach
the
same
pipe
for
a
muffler
class
for
Burke.
So
the
end
is
reset
thing.
It
really
should
be
on
the
type
of
implementation
on
the
interface,
because
the
actual
consumer
doesn't
care.
C
B
B
Else
using
wire
like
boost
read
with
yes,
there's
a
name,
damn:
okay,
it's
really
met
our
credit,
no
okay!
So,
let's
get
through
all
the
big
concepts
in
being
paid,
so
factory
creates
a
pipe
pipe
has
to
NC
right
to
a
degree
from
it.
The
connection
is
different:
zip
duplex
height,
you
have
two
girls
who
are
either
in
writer.
B
B
How's,
the
painting
flush
we
can
discuss,
watch
off
what
the
writable
buffer-
yes,
yeah,
so
think
of
it
as
like.
You
get
a
memory
or
condition
of
a
thing
that
so
the,
but
you
can
clearly
this
treatmen
SS
I.
Guess
you
get
a
thing
back,
you
right
to
it
right
to
attorney
called
flush
to
make
it
go
the
actual
and
is
it
dead
instead
turn
it
back
certify
breaks,
Ted,
nice,
Ted
and
that's
an
interesting
design
custom
because
you
can't
really
kill
it,
but
it's
dead.
E
That
always
stayed
on
itself
on
the
radar
self.
Let's
basically
yeah,
then
what
you
want
is
like
start
the
sides
and
then
right
right
right
finish
is
the
same
thing.
I
mean.
C
B
We
wanted
smaller
surface
to
pass
it
down
to
pass
other
things,
so
I
sort
of
things
in
in
theory,
this
didn't
implement
an
interface
like
I
can
write
to
this
thing
right
and
you
come
out.
You
guys
think
Mike.
You
pass
it
to
a
bunch
of
methods
that
format
into
it.
Like,
for
my
name
for
my
strength
for
my
blog,
you
get
it
back
in
a
unistall
flush
right,
but.
C
E
We
had
one,
we
don't
have
one
yet.
So
it's
a
reason,
I
mean
finally
missed
fewer
times.
Fear
concept.
Secondly,
I
think
the
like.
You
need
your
API.
You
have
to
look
very
carefully,
but
otherwise
it's
likely
because
you
could
see
and
say
hello,
K,
the
buffer
classes
around.
Look
at
again.
You
got
a
lot
of
presence
around,
but
that's
not
what
they.
B
D
B
The
way
yeah
yeah
we
could
we
could
we
could.
What
do
you
think
would
look
like
just
right,
parent
buffer
advance,
yeah
it'd
be
exposing
the
actual
span
mother's
memory
on
results,
basically,
like
I
output,
correct
this.
C
E
B
B
Okay,
yeah
I,
think
I
mean
you
kind
of
want
to
say
like
memory
if
you
promoted
it
and
what
you're
flush
kill
them,
the
writer,
the
pipe
writer,
is
it
done
when
you
flush,
there's
no
bail,
it's
not
done
complete
that
so
completely
I'm
done.
Writing
completely
flushes
like
flush.
My
current
reader
that
I
wrote
a
thing
yeah.
B
B
So
this
is
kind
of
disaster,
but
but
so
quick
trust
me
explain
this
one
a
little
bit.
Even
the
diplomats,
output,
yeah,
see
ya
thing
back
great
and
you
can
get
the
buffer
from
it.
So
you
can
write
to
it,
but
it
has
it
excites.
And
then
you
want
to
grow
it.
You
call
insurer
or
the
clincher
yeah.
So
are
you
growing
it?
You
already
allocated
a
fixed
size,
but
in
forever
ties
its
mid-sized
record,
so
you
see
like
gimme
4k
and
you
write
to
it.
B
You
right
a
lay-oh
and
you
say,
like
grown
a
new
key
phrase
over
and
over
and
over.
So
it
is
to
hopping
up
things
like
here,
so
you
can
build.
Higher
element
is
like
right
and
do
like
so
that
we
want
to
make
yourself
done.
It
should
be
allocated
should
be
sure
should
be
something
close
because
you're
going
to
change,
use.
Okay,.
C
B
C
C
B
B
B
It
I've
been
period.
Make
you
for
now.
I'm
looking
to
seep
up
is
nothing
wrong.
With
looking
what
you
waited
to
wrote
there
was,
there
was
a
kiss
for
it,
regionally
that
I
never
seen
by
camera.
What
the
case
was
not
it
was.
It
was
trying
to
get
a
length,
so
I
would
see
it
see.
You
write
a
bunch
of
data
and
you
want
to
get
the
length.
We
just
wrote
the
so-called
bytes
written
and
you
want
to
get
the
contacts
you.
D
D
B
B
Decorate
this
thing,
because
you
explicit
buffer-
and
you
can't
think
you
can't
wrap
it-
was
returned
to
someone
else
that
was
my
wife
so
hard
to
look
at
the
data
extreme.
You
you
overwrite
this
buffer
already
offer
is
like
a
hurry.
Yeah
sure
you
have
a
way
of
reading
it.
You
can't
decorate
that
thing,
but
you
have
a
way
of
reading.
So
you
might
so
imagine
you
wanted
to
create
this
thing.
Pasta,
but
I've
read
about
stuff
right
that
they
that
they
get
the
controller.
D
B
Or
ensure,
how
do
you
look
at
the
yeah
there's,
no
way
that
you
know
I'm
not
that
create
this
thing
like
you
in
stream,
you
you
afraid
right.
Do
you
think
you
handle
on
the
right
color
holistically
lovers
as
they
pass
through?
They
say
that
you
can
do
it
whenever
we
call
number
someone
calls
come
in
at
bat
like
what
do
you
do
can
come
up
with
a
scenario
why
you
need
to
read
your
first
and
then
we
can
talk
about
this.
It's
like
it's
like
seeing.
B
B
B
For
reasons
reasons,
reasons
for
reasons:
they're
bad,
but
they're
good.
So
what
are
the
reasons
if
you
wanna,
if
you
have
this
chain
of
data,
this
chin
of
this
place?
Imagine
this
is
like
compression
are.
This
is
kind
of
like
pipeline
is,
and
this
process
in
between
doing
this
thing
is
compression
or
whatever.
B
B
Though
so,
would
you
be
on
the
result
when
you
when
you
consume,
therefore
my
pipe
yes
today?
If
but
the
change
you
guys,
wanna
propose
it
to
make
it
read
only
I'm
saying
there
cases
where
you
wanted
to
turn
that
buffer
in
system,
you
guys
is
in
four
different
pipe.
They
want
to
write
in
to
see
you
may
want
to
edit
the
in
place
to
try
to
do
a
transmission
with
allocating
and
then
pass
a
lot
of
different
mothers.
Yeah.
C
C
Almost
think
that
I
understand
the
reason
and
I
think
imagine
that
the
terminology
was
not
writable,
bother
readable
by
fair
reading.
Writing,
but
in
putting
out
and
everything
is
read
right
and
they
are
just
inputs
and
outputs.
That's
basically
a
better
terminology
given
this
mother,
do
you
think
if
a
letter
will
be
confusing
yeah?
It
is.
C
C
What
you
actually
mean
is
pipes
are
just
transports
of
readwrite
byte
arrays.
Yes,
they
are
not
yet
for
reading
or
writing.
They
are
just
transferred.
So
I
want
to
read
this
to
my
mother
and,
and
the
reader
and
writer
just
correspond
to
the
ends
as
to
what
she's
supposed
to
be
doing
with
this
data.
This
reader.
B
D
We
also
know
out
return
the
same
if
you're
doing
consumed
entire
data
will
give
you
the
same
blocks
again
when
you
read
next
time
and
if
you
modify
them
already
this,
because
okay
and
I
think
nothing's
possible,
you
get
it
the
first
time.
You
think
you
have
enough
him,
you
modified
it,
and
then
you
don't
have
enough.
So
you,
okay,
I,
don't
I,
didn't
consume
anything
and
they
get
it
next
time
and
it's
a
little
intimidated
in.
B
D
B
B
B
B
Run
this
callback
in
this
location,
this
is
like
super
low.
This
is
like
a
if
you're
gonna
implement
a
primitive
for
scheduling
things,
so
it
would
look
like,
like
Java
has
been
called
printable.
It's
basically
a
this
similar
fix
rate,
and
you
can
pass
it
to
arbitrary
things.
I
can
schedule
callbacks
anywhere,
but
it
takes
action
of
what
perfect
object
problem.
All
it
is
is
write
as
literally
run
this
function
like
do
a
thing
with
it.
So.
B
In
care
to
admit,
yeah,
I
think
call
a
thread
pool,
but
basically
the
same
thing
or
is
like
tell
me
where
you
want
things
to
run
so,
for
example,
in
in
for
our
first
test,
we
have
a
thread,
scarcely
more
dot
run
in
line
which
which
stays
on
the
current
transport
thread.
So
you
can
run
single
threaded
on
the
Vivi
lake
in
our
pipeline.
They
can
just
do
the
single
leg
scheduler.
So
you
say
when
you
are
doing
call
box
for
reads,
made
sure
Russ
under
to
be
thread
kind
of
works.
You
have
your
check.
E
C
E
C
C
B
B
Redefine
Dominion
yeah
all
right,
one
more
thing:
I
want
to
bring
us
pretty
pretty
important.
Before
we
go
on
I
parried,
it
is
a
call
to
advance.
This
is
kind
of
a
fundamental
thing
that
is
it
different
between
this
stream.
So
when
you
call
read
async
you
get
a
result
bypass
the
buffer
and
that
buffer
will
not
move
until
you
call
it
bats.
So
this
is
super
important.
So
let's
say
the
writer
wrote
like
something
right,
so
it
looks.
Thank
you.
B
So
the
writer
is
here
and
the
readers
here
thinking
has
a
cursor
or
the
reader
has
a
cursor
to
the
to
the
invention
of
buffers.
I
was
pretty
moderator.
That's
writer!
It's
used
to
write
data,
the
readers
consuming
it
pulling
the
writer
like
until
it
go
that
way
right
when
the
reader
gets
upper
back.
Let's
say
it
called
read:
it
got
this
data
back
right.
B
The
reader
has
to
call
a
device
to
move
the
cursor
to
move
this
cursor
to
whatever
a
consumed
right
if
it
doesn't,
and
you
close
and
keep
going
to
read
to
get
the
same
data
over
and
over,
which
means
like
yeah
there's
this.
You
might
have
to
really
say,
like
read:
async
get
some
data
cloud
lines
right,
so
that's
kind
of
disadvantage,
as
it
reads
so
we
thought
about
out
of
advancing
was
young
API,
because
we
want
the
opportunity
dock
to
advance.
I
say
we
hit
some
kind
of
separator
we're
parsing.
B
C
B
B
B
You
want
to
do
like
super
CliffsNotes
on
back
pressure
like
yeah,
so
one
of
you
that
at
bass
does
is
there's
this
there's
this
chain
between
this.
Is
this
pull
between
research,
consumer
right,
I'm,
gonna
producer?
When,
when
you
want
to
be
a
situation
where
you
don't
overlook
the
consumer,
either
way,
that's
gonna
back
off.
So
let's
say
you
create
the
pipe
that's
Isley
tannery
when
I
write
my
top
may
consume.
When
you
get
past
the
threshold
of
this,
this
ounce
bumper
advise
kind
of
relieves
the
Barbara
from
the
actual
producer.
B
So
when
you
sat
about
and
you
mark
it
as
consumed,
you're
relieving
this
number
to
be
like
whatever
it
is,
they're
so
clear
until
you
hit
that
specified
buffer
size
when
you
create
the
pipe
flush,
a
sink
always
return
to
complete
the
task.
It's
only
once
that
buffer
has
been
filled
up,
that
flush,
async
returns
an
incomplete
tasks
which
completes
once
the
reader
has
consumed
enough
of
the
buffer
that
there's
basically
drew,
and
that
happens
when
you
pod
that
see.
B
B
Constant
this
be
considered
not
seen.
You
have
a
separate
piece:
I
rather
rename
read
sages
VP
that
made
a
default
consume
everything,
because,
because
cuz
everything
means
returns,
it
butterfl
advanced
is
looking
at
as
a
snippet
says,
return
to
the
pool
and
deck
when
the
ref
color
it
for
me
and
and
that
actually
high
draft
coming
from
Ling
consumers
do
not
see
how,
because
no
no
no.
C
C
B
C
B
C
Yes,
it
is
I,
don't
know
what
I'm
saying,
but
it's
such
an
advanced
scenario
to
basically
say
I
haven't
seen
it
that
I
would
what
I
would
do
is
by
default.
You
just
call
advanced
and
when
you
consume,
it's
assumed
to
be
seen
when
you
read
and
let's
can
basically
call
another
API.
That's
like
right,
yeah
they're,
just
going
on
over
yeah
that
works.
B
E
Think
it
would
help
also
is
if
we
have
samples
that
are
actually
ballistic
I,
think
your
samples
are
all
too
complicated
yeah
about
too
many
concepts
yeah
any
computer
samples
underneath
I
think
what
we
really
help
is
like
having
dedicated
sample
that
literally
stationery.
My
advice
puts
in
10
bytes
and
doesn't
use
are
impossible.
E
C
E
E
D
C
B
Like
people
not
really,
since
we
already
named
pipes
yep,
let's
call
it
this
whole
naming
it
no.
E
Justice,
or
so
you
want
to
remove
this
faster
rather
than
all
right.
What
is
it
when
I
review
this
faster
rather
than
yes,
so
another
two
hours
lot
this
week
whole
to
be
good
good
Perez's.
For
a
day,
you
were
come
home
on
Thursday,
Sibley,
Wednesday,
tomorrow
way
to
say
anybody
is
going
on
Thursdays,
you
know,
will
set
it
off
for
Thursday's
and
then
you
can
sample
size.