On March 10, join us for the next episode of Dapr in Action a weekly live show at 11:00 AM (EST) focused on What is the Actors.
In this episode, you will understand what the Actors is, what are some of its concrete component implementations and how you can use it in your own applications.
ABSTRACT
A new weekly series about creating robust distributed applications and microservices using Dapr (Distributed Application Runtime).
Developers and software architects who are building distributed applications and/or microservices and they want to understand how Dapr can make their lives easier. I will use .NET and C#, but will try to use other languages as well (for example, Python).
šŗ CSharp TV - Dev Streaming Destination http://csharp.tv
š C# Corner - Community of Software and Data Developers https://www.c-sharpcorner.com
#CSharpTV #csharpcorner #Dapr #LiveShow
Show More Show Less View Video Transcript
0:03
[Music]
0:13
[Music]
0:29
[Music]
0:32
[Music]
0:32
[Music] hey friends this is your host
0:34
hey friends this is your host
0:35
hey friends this is your host Rodrigo and this is the Dapper in action
0:38
Rodrigo and this is the Dapper in action
0:38
Rodrigo and this is the Dapper in action Series this is the latest session
0:42
Series this is the latest session
0:42
Series this is the latest session actors
0:44
actors
0:44
actors so um we're going to see actors today
0:47
so um we're going to see actors today
0:47
so um we're going to see actors today but before I jump right in into that
0:51
but before I jump right in into that
0:51
but before I jump right in into that topic I want to show you some
0:54
topic I want to show you some
0:54
topic I want to show you some things so let's go ahead and open up the
0:59
things so let's go ahead and open up the
0:59
things so let's go ahead and open up the ter know because Dapper 1.15 was
1:04
ter know because Dapper 1.15 was
1:04
ter know because Dapper 1.15 was released I think last week uh a few days
1:09
released I think last week uh a few days
1:09
released I think last week uh a few days ago and I've been using Dapper 1.14 as
1:15
ago and I've been using Dapper 1.14 as
1:15
ago and I've been using Dapper 1.14 as you can see here on the screen so it's a
1:18
you can see here on the screen so it's a
1:18
you can see here on the screen so it's a great moment for us to go ahead and
1:21
great moment for us to go ahead and
1:21
great moment for us to go ahead and update daer I'm going to show you how to
1:24
update daer I'm going to show you how to
1:24
update daer I'm going to show you how to do that I
1:27
do that I
1:27
do that I mentioned back in the day back in
1:30
mentioned back in the day back in
1:30
mentioned back in the day back in December right when I started this
1:34
December right when I started this
1:34
December right when I started this series hey Dapper 1.15 is going to be
1:37
series hey Dapper 1.15 is going to be
1:37
series hey Dapper 1.15 is going to be released on the um December 9 through 13
1:43
released on the um December 9 through 13
1:43
released on the um December 9 through 13 it didn't happen uh but now we have
1:47
it didn't happen uh but now we have
1:47
it didn't happen uh but now we have Dapper
1:48
Dapper
1:49
Dapper 1.15 um with us
1:52
1.15 um with us
1:52
1.15 um with us today and let me show you how we
1:57
today and let me show you how we
1:57
today and let me show you how we can uh update dapper I believe I have
2:01
can uh update dapper I believe I have
2:01
can uh update dapper I believe I have something for
2:02
something for
2:02
something for you um installing the dopper CLI
2:07
you um installing the dopper CLI
2:07
you um installing the dopper CLI verifying initializing uninstalling
2:10
verifying initializing uninstalling
2:10
verifying initializing uninstalling Dapper I'm sure I mentioned this back in
2:15
Dapper I'm sure I mentioned this back in
2:15
Dapper I'm sure I mentioned this back in session
2:16
session
2:16
session one so we have two options here you can
2:20
one so we have two options here you can
2:21
one so we have two options here you can remove the side card binaries and the
2:23
remove the side card binaries and the
2:23
remove the side card binaries and the placement container just by typing
2:26
placement container just by typing
2:26
placement container just by typing dopper uninstall and you execute this
2:28
dopper uninstall and you execute this
2:29
dopper uninstall and you execute this command
2:30
command
2:30
command and you can also use the dash dash all
2:34
and you can also use the dash dash all
2:34
and you can also use the dash dash all flag to remove everything even the um
2:39
flag to remove everything even the um
2:39
flag to remove everything even the um Docker
2:40
Docker
2:40
Docker containers that are pulled from Docker
2:44
containers that are pulled from Docker
2:44
containers that are pulled from Docker Hub when you Dapper in it um so that's
2:48
Hub when you Dapper in it um so that's
2:48
Hub when you Dapper in it um so that's the technique I'm going to use today
2:50
the technique I'm going to use today
2:50
the technique I'm going to use today dopper uninstall and let's see what
2:53
dopper uninstall and let's see what
2:53
dopper uninstall and let's see what happens so I'm running Docker
2:57
happens so I'm running Docker
2:57
happens so I'm running Docker Docker PS right so this is running some
3:02
Docker PS right so this is running some
3:02
Docker PS right so this is running some containers so far so good so D on
3:07
containers so far so good so D on
3:07
containers so far so good so D on install let's see what's going on here
3:11
install let's see what's going on here
3:11
install let's see what's going on here um daer and install
3:13
um daer and install
3:13
um daer and install all
3:15
all
3:15
all see uh as you can see here on the screen
3:19
see uh as you can see here on the screen
3:19
see uh as you can see here on the screen it's going to remove the Dapper
3:20
it's going to remove the Dapper
3:20
it's going to remove the Dapper directory which is in my home
3:22
directory which is in my home
3:22
directory which is in my home folder in all the docker container such
3:26
folder in all the docker container such
3:26
folder in all the docker container such as radius and the placement uh container
3:29
as radius and the placement uh container
3:29
as radius and the placement uh container place m is actually the service that is
3:32
place m is actually the service that is
3:32
place m is actually the service that is going to place the actors
3:35
going to place the actors
3:35
going to place the actors around the pods when you deploy um
3:39
around the pods when you deploy um
3:39
around the pods when you deploy um Dapper in kubernetes and of course if
3:43
Dapper in kubernetes and of course if
3:43
Dapper in kubernetes and of course if you're running in your own machine this
3:46
you're running in your own machine this
3:46
you're running in your own machine this is the place and this is the service
3:48
is the place and this is the service
3:48
is the place and this is the service that is going to move those objects
3:51
that is going to move those objects
3:52
that is going to move those objects around the placement
3:54
around the placement
3:54
around the placement service um scheduler in
3:57
service um scheduler in
3:58
service um scheduler in Zipkin so let's go go ahead and see what
4:01
Zipkin so let's go go ahead and see what
4:01
Zipkin so let's go go ahead and see what happens so first let's
4:04
happens so first let's
4:04
happens so first let's ensure that I have do dapper
4:08
ensure that I have do dapper
4:08
ensure that I have do dapper remember right so Dapper on
4:12
remember right so Dapper on
4:12
remember right so Dapper on install Double Dash all and this is
4:17
install Double Dash all and this is
4:17
install Double Dash all and this is removing that do dapper folder and those
4:22
removing that do dapper folder and those
4:22
removing that do dapper folder and those containers and also the entire Dapper
4:26
containers and also the entire Dapper
4:26
containers and also the entire Dapper folder and it's going to remove a volume
4:29
folder and it's going to remove a volume
4:29
folder and it's going to remove a volume if it exists which is not the case and
4:32
if it exists which is not the case and
4:33
if it exists which is not the case and that's it no
4:36
that's it no
4:36
that's it no Dapper Dapper
4:38
Dapper Dapper
4:38
Dapper Dapper version of course I have the CLI right
4:42
version of course I have the CLI right
4:43
version of course I have the CLI right because remember those are two different
4:45
because remember those are two different
4:45
because remember those are two different things this is the CLI that you can find
4:47
things this is the CLI that you can find
4:47
things this is the CLI that you can find here on the Dapper folder in the root of
4:50
here on the Dapper folder in the root of
4:50
here on the Dapper folder in the root of my C drive and your C drive and so this
4:55
my C drive and your C drive and so this
4:55
my C drive and your C drive and so this is the CLI and of course I need to
4:58
is the CLI and of course I need to
4:58
is the CLI and of course I need to update the C live first so let's see if
5:02
update the C live first so let's see if
5:02
update the C live first so let's see if we have
5:04
we have
5:04
we have something um we
5:07
something um we
5:07
something um we have uh installed up a wrong time I
5:10
have uh installed up a wrong time I
5:10
have uh installed up a wrong time I already did
5:11
already did
5:11
already did this uh upgrade version um I don't see
5:17
this uh upgrade version um I don't see
5:17
this uh upgrade version um I don't see something for the CLI but let's go ahead
5:24
something for the CLI but let's go ahead
5:24
something for the CLI but let's go ahead and Dapper
5:27
and Dapper
5:27
and Dapper doio and I I want to execute the
5:30
doio and I I want to execute the
5:30
doio and I I want to execute the Powershell command that installs the
5:32
Powershell command that installs the
5:32
Powershell command that installs the latest version of the CLI so dogs and
5:39
latest version of the CLI so dogs and
5:39
latest version of the CLI so dogs and then uh getting started first step
5:42
then uh getting started first step
5:42
then uh getting started first step install the dopper
5:44
install the dopper
5:44
install the dopper CLI install from terminal this is Linux
5:47
CLI install from terminal this is Linux
5:47
CLI install from terminal this is Linux I want to select windows
5:50
I want to select windows
5:50
I want to select windows and so install from command prompt I
5:55
and so install from command prompt I
5:55
and so install from command prompt I think this is it right this is the one
5:59
think this is it right this is the one
5:59
think this is it right this is the one in of course you can use a specific
6:02
in of course you can use a specific
6:02
in of course you can use a specific version with this other um option here
6:06
version with this other um option here
6:06
version with this other um option here so let's see what
6:09
so let's see what
6:09
so let's see what happens as you can see I'm using the
6:12
happens as you can see I'm using the
6:12
happens as you can see I'm using the administrator
6:15
administrator
6:15
administrator terminal so Dapper is detected CLI
6:18
terminal so Dapper is detected CLI
6:18
terminal so Dapper is detected CLI version blah blah blah
6:21
version blah blah blah
6:21
version blah blah blah downloading
6:23
downloading
6:23
downloading something it's going to because uh I
6:26
something it's going to because uh I
6:26
something it's going to because uh I don't know what's downloading right now
6:29
don't know what's downloading right now
6:29
don't know what's downloading right now right
6:30
right
6:30
right three dots it's not very helpful of
6:33
three dots it's not very helpful of
6:33
three dots it's not very helpful of course it was downloading the CLI the
6:35
course it was downloading the CLI the
6:35
course it was downloading the CLI the 1.15 CLI Okay cool so
6:40
1.15 CLI Okay cool so
6:40
1.15 CLI Okay cool so Dapper Double Dash
6:43
Dapper Double Dash
6:43
Dapper Double Dash version ER
6:46
version ER
6:46
version ER Bravo okay cool Dapper
6:49
Bravo okay cool Dapper
6:49
Bravo okay cool Dapper one15 and now I'm ready to go ahead and
6:54
one15 and now I'm ready to go ahead and
6:54
one15 and now I'm ready to go ahead and Dapper in
6:55
Dapper in
6:55
Dapper in it right so remember that you have some
6:59
it right so remember that you have some
6:59
it right so remember that you have some other options such as the dash key
7:02
other options such as the dash key
7:02
other options such as the dash key option for installing and initializing
7:07
option for installing and initializing
7:07
option for installing and initializing diering kubernetes which is not the case
7:09
diering kubernetes which is not the case
7:09
diering kubernetes which is not the case right
7:10
right
7:10
right now and I think um that's
7:15
now and I think um that's
7:15
now and I think um that's important and you have other options as
7:18
important and you have other options as
7:18
important and you have other options as well um and you also have the
7:23
well um and you also have the
7:23
well um and you also have the slim option that is going to exclude the
7:26
slim option that is going to exclude the
7:26
slim option that is going to exclude the placement service the scheduler radi and
7:28
placement service the scheduler radi and
7:28
placement service the scheduler radi and Zipkin
7:30
Zipkin
7:30
Zipkin so in other words if you use the dash s
7:33
so in other words if you use the dash s
7:33
so in other words if you use the dash s or Double Dash slim option you're
7:36
or Double Dash slim option you're
7:36
or Double Dash slim option you're responsible for downloading and
7:38
responsible for downloading and
7:38
responsible for downloading and installing those uh concrete components
7:43
installing those uh concrete components
7:43
installing those uh concrete components meaning the state um
7:46
meaning the state um
7:46
meaning the state um management component right and the
7:49
management component right and the
7:49
management component right and the observability option that you want and
7:53
observability option that you want and
7:53
observability option that you want and of course the placement service and a
7:54
of course the placement service and a
7:54
of course the placement service and a schedular service you have to
7:57
schedular service you have to
7:57
schedular service you have to manually uh initialize them
8:00
manually uh initialize them
8:00
manually uh initialize them which is not the case I'm just going to
8:03
which is not the case I'm just going to
8:03
which is not the case I'm just going to uh execute Dapper in it because it's so
8:05
uh execute Dapper in it because it's so
8:05
uh execute Dapper in it because it's so cool so easy so comfortable to do this
8:10
cool so easy so comfortable to do this
8:10
cool so easy so comfortable to do this so it's going to install the wrong time
8:15
1.5.3 okay
8:18
1.5.3 okay
8:18
1.5.3 okay cool and it's going to download the
8:21
cool and it's going to download the
8:21
cool and it's going to download the binaries speaking of which if I execute
8:24
binaries speaking of which if I execute
8:24
binaries speaking of which if I execute Docker PS uh something is going on here
8:31
Docker PS uh something is going on here
8:31
Docker PS uh something is going on here okay so let's wait and see what's the
8:35
okay so let's wait and see what's the
8:35
okay so let's wait and see what's the final result of doing
8:38
final result of doing
8:38
final result of doing this uh which
8:40
this uh which
8:40
this uh which is um you know having those
8:45
is um you know having those
8:45
is um you know having those containers dopper placement container
8:47
containers dopper placement container
8:47
containers dopper placement container running ready zipin
8:49
running ready zipin
8:49
running ready zipin scheduler and the dopper binary has been
8:52
scheduler and the dopper binary has been
8:52
scheduler and the dopper binary has been installed this is important right so
8:54
installed this is important right so
8:54
installed this is important right so let's navigate to home and then Dapper
8:59
let's navigate to home and then Dapper
8:59
let's navigate to home and then Dapper and I have the daer folder back
9:03
and I have the daer folder back
9:03
and I have the daer folder back again so if I navigate to components I
9:07
again so if I navigate to components I
9:07
again so if I navigate to components I can find state store and pops up those
9:10
can find state store and pops up those
9:10
can find state store and pops up those manifest files that I've showed you in
9:13
manifest files that I've showed you in
9:13
manifest files that I've showed you in the past so let's for instance see the
9:17
the past so let's for instance see the
9:17
the past so let's for instance see the contents of pops up this is using redis
9:21
contents of pops up this is using redis
9:21
contents of pops up this is using redis my Local Host um execution of
9:25
my Local Host um execution of
9:25
my Local Host um execution of red that is of course the docker
9:28
red that is of course the docker
9:28
red that is of course the docker container running on Port
9:32
container running on Port
9:32
container running on Port 6379 and let's see what's the
9:36
6379 and let's see what's the
9:36
6379 and let's see what's the content uh of this manifest state
9:40
content uh of this manifest state
9:40
content uh of this manifest state store and of course this other one is
9:42
store and of course this other one is
9:42
store and of course this other one is using RIS as
9:44
using RIS as
9:44
using RIS as well and take into account this
9:48
well and take into account this
9:48
well and take into account this attribute actor state store so this is
9:51
attribute actor state store so this is
9:51
attribute actor state store so this is important friends since the actor model
9:56
important friends since the actor model
9:56
important friends since the actor model that I'm going to show you today the
9:58
that I'm going to show you today the
9:58
that I'm going to show you today the basics of the actor
10:01
basics of the actor
10:01
basics of the actor model and its concrete implementation in
10:05
model and its concrete implementation in
10:05
model and its concrete implementation in Dapper
10:07
Dapper
10:07
Dapper needs something like a state management
10:09
needs something like a state management
10:09
needs something like a state management store because
10:11
store because
10:11
store because actors they store their
10:15
actors they store their
10:15
actors they store their state right and they need they need a
10:19
state right and they need they need a
10:19
state right and they need they need a place to store the state so that's why
10:22
place to store the state so that's why
10:22
place to store the state so that's why in this case you can enable actor
10:26
in this case you can enable actor
10:26
in this case you can enable actor support in your state store by by using
10:29
support in your state store by by using
10:29
support in your state store by by using the actor state store
10:31
the actor state store
10:31
the actor state store attribute of course you have to take
10:34
attribute of course you have to take
10:34
attribute of course you have to take into account that not all the different
10:37
into account that not all the different
10:37
into account that not all the different uh State Stores support
10:40
uh State Stores support
10:40
uh State Stores support actors I believe so let's go back here
10:45
actors I believe so let's go back here
10:45
actors I believe so let's go back here and navigate to pops up no this is not
10:47
and navigate to pops up no this is not
10:47
and navigate to pops up no this is not one state
10:49
one state
10:49
one state management and this is the explanation
10:53
management and this is the explanation
10:53
management and this is the explanation of State
10:54
of State
10:54
of State Management and API
10:57
Management and API
10:57
Management and API reference and
10:59
reference and
10:59
reference and let's see if we can
11:01
let's see if we can
11:01
let's see if we can see um a
11:04
see um a
11:04
see um a list um state store
11:10
components so take into account this
11:13
components so take into account this
11:13
components so take into account this column right check this
11:15
column right check this
11:15
column right check this out so not all of them support
11:19
out so not all of them support
11:19
out so not all of them support actors of course redis which is the
11:21
actors of course redis which is the
11:22
actors of course redis which is the default it supports like everything
11:24
default it supports like everything
11:24
default it supports like everything right so this is the
11:27
right so this is the
11:27
right so this is the one and just be careful because I don't
11:31
one and just be careful because I don't
11:31
one and just be careful because I don't know maybe you are trying to use gcp fir
11:34
know maybe you are trying to use gcp fir
11:34
know maybe you are trying to use gcp fir store or I don't know the Asher blob
11:38
store or I don't know the Asher blob
11:38
store or I don't know the Asher blob storage and they don't support actors as
11:42
storage and they don't support actors as
11:42
storage and they don't support actors as you can see here on this table
11:46
you can see here on this table
11:46
you can see here on this table okay okay so far so good Dapper
11:49
okay okay so far so good Dapper
11:50
okay okay so far so good Dapper 1.15 I have my components for pops up
11:53
1.15 I have my components for pops up
11:53
1.15 I have my components for pops up and state store so far so good and
11:58
and state store so far so good and
11:58
and state store so far so good and nothing is running
12:00
nothing is running
12:00
nothing is running and Life's good right now okay
12:05
cool awesome what in the world are
12:10
cool awesome what in the world are
12:10
cool awesome what in the world are actors in the context of uh distributed
12:15
actors in the context of uh distributed
12:15
actors in the context of uh distributed computing so actors come from the actor
12:18
computing so actors come from the actor
12:18
computing so actors come from the actor model that was created many many many
12:22
model that was created many many many
12:22
model that was created many many many many many years ago like in the
12:25
many many years ago like in the
12:25
many many years ago like in the 70s and this is just the theory the
12:28
70s and this is just the theory the
12:28
70s and this is just the theory the actual model okay that says an actor is
12:32
actual model okay that says an actor is
12:32
actual model okay that says an actor is a basic unit unit of
12:35
a basic unit unit of
12:35
a basic unit unit of computation and it's allowed to do some
12:38
computation and it's allowed to do some
12:38
computation and it's allowed to do some processing and store some things and
12:41
processing and store some things and
12:41
processing and store some things and communicate between actors they can send
12:44
communicate between actors they can send
12:44
communicate between actors they can send message between each other and that is
12:47
message between each other and that is
12:47
message between each other and that is actually the only way that you can use
12:49
actually the only way that you can use
12:49
actually the only way that you can use for changing the state of the
12:52
for changing the state of the
12:52
for changing the state of the actor that's it uh of course I'm just uh
12:56
actor that's it uh of course I'm just uh
12:56
actor that's it uh of course I'm just uh uh this is in plain English uh there are
13:00
uh this is in plain English uh there are
13:00
uh this is in plain English uh there are many other details around the actor
13:03
many other details around the actor
13:03
many other details around the actor model you can read the paper created by
13:05
model you can read the paper created by
13:05
model you can read the paper created by Carl hwit uh back in the day and it's um
13:10
Carl hwit uh back in the day and it's um
13:10
Carl hwit uh back in the day and it's um it's uh you can dive deeper into this
13:13
it's uh you can dive deeper into this
13:13
it's uh you can dive deeper into this but this is actually the gist okay this
13:16
but this is actually the gist okay this
13:16
but this is actually the gist okay this is the gist of the actor model you have
13:19
is the gist of the actor model you have
13:19
is the gist of the actor model you have an
13:20
an
13:20
an actor that performs some kind of
13:24
actor that performs some kind of
13:24
actor that performs some kind of processing and storts its
13:27
processing and storts its
13:27
processing and storts its state okay so it's actors have stayed
13:31
state okay so it's actors have stayed
13:31
state okay so it's actors have stayed and they can communicate between each
13:33
and they can communicate between each
13:33
and they can communicate between each other by using
13:35
other by using
13:35
other by using messages and they use this uh concept of
13:39
messages and they use this uh concept of
13:39
messages and they use this uh concept of a mailbox so you can send a message to
13:42
a mailbox so you can send a message to
13:42
a mailbox so you can send a message to an actor by using its
13:45
an actor by using its
13:45
an actor by using its mailbox and the actor retrieves the
13:48
mailbox and the actor retrieves the
13:48
mailbox and the actor retrieves the message and executes the thing right
13:52
message and executes the thing right
13:52
message and executes the thing right executes the logic behind the message uh
13:57
executes the logic behind the message uh
13:57
executes the logic behind the message uh retrieval
13:59
retrieval
14:00
retrieval so far so good this is the theory and
14:02
so far so good this is the theory and
14:02
so far so good this is the theory and there are many different implementations
14:05
there are many different implementations
14:05
there are many different implementations in concrete implementations right of the
14:08
in concrete implementations right of the
14:08
in concrete implementations right of the actor
14:09
actor
14:09
actor model so Dapper is one and there are
14:13
model so Dapper is one and there are
14:13
model so Dapper is one and there are many others okay so let's continue with
14:16
many others okay so let's continue with
14:16
many others okay so let's continue with the explanation uh as I said before an
14:19
the explanation uh as I said before an
14:19
the explanation uh as I said before an actor sends and receives messages by
14:21
actor sends and receives messages by
14:21
actor sends and receives messages by using this concept of a
14:23
using this concept of a
14:24
using this concept of a mailbox and when it receives a message
14:27
mailbox and when it receives a message
14:27
mailbox and when it receives a message it can do
14:29
it can do
14:29
it can do mostly three things mainly right it can
14:33
mostly three things mainly right it can
14:33
mostly three things mainly right it can send messages to other actors that it
14:36
send messages to other actors that it
14:36
send messages to other actors that it knows
14:37
knows
14:37
knows about um and or it can create some more
14:43
about um and or it can create some more
14:43
about um and or it can create some more actors right and finally it can Define
14:47
actors right and finally it can Define
14:47
actors right and finally it can Define what's going on with um what's going to
14:50
what's going on with um what's going to
14:50
what's going on with um what's going to do with the next message it receives
14:52
do with the next message it receives
14:52
do with the next message it receives that is actually the theory behind those
14:55
that is actually the theory behind those
14:55
that is actually the theory behind those actors this is the theory again
14:57
actors this is the theory again
14:57
actors this is the theory again okay so so in Dapper Dapper implements
15:02
okay so so in Dapper Dapper implements
15:02
okay so so in Dapper Dapper implements the virtual actor
15:04
the virtual actor
15:05
the virtual actor pattern that was created in Project
15:08
pattern that was created in Project
15:08
pattern that was created in Project Orleans by Microsoft some years
15:11
Orleans by Microsoft some years
15:11
Orleans by Microsoft some years ago Orleans is kind of cool because it's
15:16
ago Orleans is kind of cool because it's
15:16
ago Orleans is kind of cool because it's the concrete
15:17
the concrete
15:17
the concrete implementation of the theory behind the
15:20
implementation of the theory behind the
15:20
implementation of the theory behind the actor
15:21
actor
15:21
actor model but Microsoft style right
15:25
model but Microsoft style right
15:25
model but Microsoft style right Microsoft is thing uh so if you go and
15:30
Microsoft is thing uh so if you go and
15:31
Microsoft is thing uh so if you go and find information about
15:33
find information about
15:33
find information about Orleans Orleans is not new it actually
15:37
Orleans Orleans is not new it actually
15:37
Orleans Orleans is not new it actually comes from many years ago as well uh
15:41
comes from many years ago as well uh
15:41
comes from many years ago as well uh since um 2010 2011 something like that
15:47
since um 2010 2011 something like that
15:47
since um 2010 2011 something like that and Orleans was created it's a Implement
15:51
and Orleans was created it's a Implement
15:51
and Orleans was created it's a Implement implementation of the actor model and
15:54
implementation of the actor model and
15:54
implementation of the actor model and there was this very very famous
15:59
there was this very very famous
15:59
there was this very very famous um
16:00
um
16:01
um implementation um inspired by Orleans in
16:05
implementation um inspired by Orleans in
16:05
implementation um inspired by Orleans in Microsoft in service
16:08
Microsoft in service
16:08
Microsoft in service fabric so you might remember service
16:11
fabric so you might remember service
16:11
fabric so you might remember service fabric it is actually current you can
16:14
fabric it is actually current you can
16:14
fabric it is actually current you can use service fabric today but when
16:18
use service fabric today but when
16:18
use service fabric today but when the Container Wars you know the
16:21
the Container Wars you know the
16:21
the Container Wars you know the orchestrator wars
16:23
orchestrator wars
16:23
orchestrator wars began uh back in 2010 I guess when
16:27
began uh back in 2010 I guess when
16:27
began uh back in 2010 I guess when kubernetes was created
16:29
kubernetes was created
16:29
kubernetes was created so kubernetes won the
16:32
so kubernetes won the
16:32
so kubernetes won the war and but back in the day we had in
16:36
war and but back in the day we had in
16:36
war and but back in the day we had in Microsoft the service fabric
16:39
Microsoft the service fabric
16:39
Microsoft the service fabric SDK that Microsoft released as a as an
16:43
SDK that Microsoft released as a as an
16:43
SDK that Microsoft released as a as an open- source
16:44
open- source
16:44
open- source project and of course we have Microsoft
16:48
project and of course we have Microsoft
16:48
project and of course we have Microsoft service fabric nowadays you can deploy
16:50
service fabric nowadays you can deploy
16:50
service fabric nowadays you can deploy and you can provision some resources
16:53
and you can provision some resources
16:54
and you can provision some resources behind uh that kind of uh
16:57
behind uh that kind of uh
16:57
behind uh that kind of uh Computing in other words you can use
16:59
Computing in other words you can use
16:59
Computing in other words you can use service fabric today but it's not that
17:01
service fabric today but it's not that
17:01
service fabric today but it's not that people do regularly because kubernetes
17:04
people do regularly because kubernetes
17:04
people do regularly because kubernetes is more popular and it was better for a
17:09
is more popular and it was better for a
17:09
is more popular and it was better for a lot of
17:10
lot of
17:10
lot of companies however service fabric
17:13
companies however service fabric
17:13
companies however service fabric implemented the virtual actor pattern
17:17
implemented the virtual actor pattern
17:17
implemented the virtual actor pattern remember Orleans was the project and
17:21
remember Orleans was the project and
17:21
remember Orleans was the project and they created I mean the service fabric
17:23
they created I mean the service fabric
17:23
they created I mean the service fabric team created the
17:25
team created the
17:25
team created the reliable
17:27
reliable
17:27
reliable actors um
17:29
actors um
17:29
actors um SDK and platform the development
17:31
SDK and platform the development
17:31
SDK and platform the development platform for creating actors on top of
17:35
platform for creating actors on top of
17:35
platform for creating actors on top of service Fabric and it was pretty pretty
17:39
service Fabric and it was pretty pretty
17:39
service Fabric and it was pretty pretty cool so I believe the reliable Services
17:43
cool so I believe the reliable Services
17:43
cool so I believe the reliable Services the ones with the state uh are similar
17:46
the ones with the state uh are similar
17:46
the ones with the state uh are similar to uh those reliable actors uh in the
17:50
to uh those reliable actors uh in the
17:50
to uh those reliable actors uh in the inner
17:51
inner
17:51
inner workings um anyway if you happen to be a
17:55
workings um anyway if you happen to be a
17:55
workings um anyway if you happen to be a service fabric developer do you know
17:56
service fabric developer do you know
17:56
service fabric developer do you know what I'm talking about if you don't
17:59
what I'm talking about if you don't
17:59
what I'm talking about if you don't don't worry it doesn't matter I'm just
18:01
don't worry it doesn't matter I'm just
18:01
don't worry it doesn't matter I'm just explaining a little bit of history
18:03
explaining a little bit of history
18:03
explaining a little bit of history behind Orleans and the implementation in
18:06
behind Orleans and the implementation in
18:06
behind Orleans and the implementation in service fabric but that's it that's it
18:10
service fabric but that's it that's it
18:10
service fabric but that's it that's it so
18:11
so
18:11
so Dapper inspired by the virtual actor
18:14
Dapper inspired by the virtual actor
18:14
Dapper inspired by the virtual actor pattern it implements the virtual actor
18:17
pattern it implements the virtual actor
18:17
pattern it implements the virtual actor pattern uh that comes from Orleans and
18:21
pattern uh that comes from Orleans and
18:21
pattern uh that comes from Orleans and it is actually very similar you have
18:23
it is actually very similar you have
18:23
it is actually very similar you have those actors that have stayed and
18:29
those actors that have stayed and
18:29
those actors that have stayed and you don't have to worry about the
18:32
you don't have to worry about the
18:32
you don't have to worry about the messaging thing and the infrastructure
18:34
messaging thing and the infrastructure
18:34
messaging thing and the infrastructure behind sending those messages to the
18:37
behind sending those messages to the
18:37
behind sending those messages to the mail boxes that each actor has you know
18:43
mail boxes that each actor has you know
18:43
mail boxes that each actor has you know so this is pretty cool because you can
18:44
so this is pretty cool because you can
18:45
so this is pretty cool because you can focus on business logic rather than on
18:49
focus on business logic rather than on
18:50
focus on business logic rather than on infrastructure challenges right it's no
18:54
infrastructure challenges right it's no
18:54
infrastructure challenges right it's no fun to be you
18:56
fun to be you
18:56
fun to be you know uh configuring and doing those
19:00
know uh configuring and doing those
19:00
know uh configuring and doing those infrastructure things when you're trying
19:02
infrastructure things when you're trying
19:02
infrastructure things when you're trying to engineer a solution by using the
19:04
to engineer a solution by using the
19:04
to engineer a solution by using the virtual actor I mean by using the actor
19:07
virtual actor I mean by using the actor
19:07
virtual actor I mean by using the actor model that's why the virtual actor
19:09
model that's why the virtual actor
19:09
model that's why the virtual actor pattern is uh so
19:11
pattern is uh so
19:11
pattern is uh so cool so in other words dber implements
19:16
cool so in other words dber implements
19:16
cool so in other words dber implements the virtual actor pattern that comes
19:18
the virtual actor pattern that comes
19:18
the virtual actor pattern that comes from project
19:19
from project
19:19
from project orance and it provides all the
19:22
orance and it provides all the
19:22
orance and it provides all the infrastructure needs that you require
19:25
infrastructure needs that you require
19:25
infrastructure needs that you require for your solution and it also provides
19:28
for your solution and it also provides
19:28
for your solution and it also provides skill ability and reliability that you
19:31
skill ability and reliability that you
19:31
skill ability and reliability that you expect from a platform such as Dapper
19:34
expect from a platform such as Dapper
19:34
expect from a platform such as Dapper which is marvelous and
19:37
which is marvelous and
19:37
which is marvelous and fantastic okay so that's the
19:40
fantastic okay so that's the
19:40
fantastic okay so that's the explanation
19:42
explanation
19:42
explanation okay how in the world we're going to do
19:46
okay how in the world we're going to do
19:46
okay how in the world we're going to do this okay let's
19:48
this okay let's
19:48
this okay let's see diaper in
19:51
see diaper in
19:51
see diaper in action so I have some
19:54
action so I have some
19:54
action so I have some folders um actors
19:59
folders um actors
19:59
folders um actors I don't have an actors okay actors so
20:03
I don't have an actors okay actors so
20:03
I don't have an actors okay actors so net
20:04
net
20:04
net new so I can create a console
20:07
new so I can create a console
20:07
new so I can create a console application I can create any kind of
20:10
application I can create any kind of
20:10
application I can create any kind of application remember that Dapper
20:13
application remember that Dapper
20:13
application remember that Dapper provides an SDK for net applications for
20:17
provides an SDK for net applications for
20:17
provides an SDK for net applications for net developers so in this case I want to
20:20
net developers so in this case I want to
20:20
net developers so in this case I want to use net web API and let's name it my
20:24
use net web API and let's name it my
20:24
use net web API and let's name it my actors because you know that's up pretty
20:29
actors because you know that's up pretty
20:29
actors because you know that's up pretty cool name and let's use controllers
20:32
cool name and let's use controllers
20:32
cool name and let's use controllers because you know me um I'm not a minimal
20:36
because you know me um I'm not a minimal
20:37
because you know me um I'm not a minimal apis kind of person so use controllers I
20:40
apis kind of person so use controllers I
20:40
apis kind of person so use controllers I believe those are cooler and I have this
20:45
believe those are cooler and I have this
20:45
believe those are cooler and I have this let's create net new
20:48
let's create net new
20:48
let's create net new solution which is the sln file and Net
20:53
solution which is the sln file and Net
20:53
solution which is the sln file and Net Solution add this project and that's it
20:57
Solution add this project and that's it
20:57
Solution add this project and that's it my actors
21:00
solution so this is going to open in
21:03
solution so this is going to open in
21:03
solution so this is going to open in Visual Studio
21:06
Visual Studio
21:06
Visual Studio 2022 um remember that you can also use
21:09
2022 um remember that you can also use
21:09
2022 um remember that you can also use Visual Studio code but I'm more a visual
21:12
Visual Studio code but I'm more a visual
21:12
Visual Studio code but I'm more a visual studio 2022 kind of
21:15
studio 2022 kind of
21:15
studio 2022 kind of person and this is a regular web API
21:18
person and this is a regular web API
21:18
person and this is a regular web API nothing fancy here and take into account
21:22
nothing fancy here and take into account
21:22
nothing fancy here and take into account that we
21:24
that we
21:24
that we have an Sate for actors this is not the
21:29
have an Sate for actors this is not the
21:29
have an Sate for actors this is not the same one as the one that we
21:32
same one as the one that we
21:32
same one as the one that we use um for other kind of projects in
21:37
use um for other kind of projects in
21:37
use um for other kind of projects in Dapper so let's search for Dapper and
21:41
Dapper so let's search for Dapper and
21:41
Dapper so let's search for Dapper and this is the one okay as you can see
21:43
this is the one okay as you can see
21:44
this is the one okay as you can see there are two Dapper actors is the core
21:49
there are two Dapper actors is the core
21:49
there are two Dapper actors is the core uh libraries for using actors in Dapper
21:51
uh libraries for using actors in Dapper
21:52
uh libraries for using actors in Dapper and this is the you know some goodies
21:56
and this is the you know some goodies
21:56
and this is the you know some goodies for asp.net core develop
21:59
for asp.net core develop
21:59
for asp.net core develop such as adding the actors in the
22:02
such as adding the actors in the
22:02
such as adding the actors in the dependency uh injection container and
22:05
dependency uh injection container and
22:05
dependency uh injection container and using you know asp.net core kind of um
22:10
using you know asp.net core kind of um
22:10
using you know asp.net core kind of um um
22:11
um
22:11
um style when building application so this
22:13
style when building application so this
22:13
style when building application so this is the one that I'm going to use uh at
22:16
is the one that I'm going to use uh at
22:16
is the one that I'm going to use uh at the time of this recording the latest
22:18
the time of this recording the latest
22:18
the time of this recording the latest one is uh 1.15 one .1 this one okay
22:26
install and let's accept the
22:31
install and let's accept the
22:31
install and let's accept the license and we're ready to rumble so
22:35
license and we're ready to rumble so
22:35
license and we're ready to rumble so this is just a package reference nothing
22:38
this is just a package reference nothing
22:38
this is just a package reference nothing fancy and let me change
22:41
fancy and let me change
22:41
fancy and let me change the what's going on here okay
22:45
the what's going on here okay
22:45
the what's going on here okay cool so package reference you don't need
22:49
cool so package reference you don't need
22:49
cool so package reference you don't need to use Dapper do ASP net
22:52
to use Dapper do ASP net
22:52
to use Dapper do ASP net core if you're gonna use actors so
22:56
core if you're gonna use actors so
22:56
core if you're gonna use actors so inside this reference
22:59
inside this reference
22:59
inside this reference is
23:00
is
23:00
is um there are other uh dependencies that
23:05
um there are other uh dependencies that
23:05
um there are other uh dependencies that this nuk package
23:07
this nuk package
23:07
this nuk package has So Okay
23:10
has So Okay
23:10
has So Okay cool so let's create an actor an actor
23:14
cool so let's create an actor an actor
23:14
cool so let's create an actor an actor is this computational
23:18
is this computational
23:18
is this computational unit um you can think about actors as
23:21
unit um you can think about actors as
23:21
unit um you can think about actors as entities that have stay for instance or
23:25
entities that have stay for instance or
23:25
entities that have stay for instance or for example you can use actors for let's
23:28
for example you can use actors for let's
23:28
for example you can use actors for let's say a shopping
23:30
say a shopping
23:31
say a shopping cart the shopping cart itself needs a
23:34
cart the shopping cart itself needs a
23:34
cart the shopping cart itself needs a state so you can model your shopping
23:37
state so you can model your shopping
23:37
state so you can model your shopping cart as an actor by using Dapper or I
23:42
cart as an actor by using Dapper or I
23:42
cart as an actor by using Dapper or I don't know an employee in side an HR
23:46
don't know an employee in side an HR
23:46
don't know an employee in side an HR kind of system or a patient in a
23:50
kind of system or a patient in a
23:50
kind of system or a patient in a hospital application or a pet in a b
23:54
hospital application or a pet in a b
23:54
hospital application or a pet in a b Nary Hospital application and so on so
23:58
Nary Hospital application and so on so
23:58
Nary Hospital application and so on so actors are granular in that sense um so
24:04
actors are granular in that sense um so
24:04
actors are granular in that sense um so those are the enemies that have stayed
24:06
those are the enemies that have stayed
24:06
those are the enemies that have stayed and you want to send messages to to them
24:09
and you want to send messages to to them
24:09
and you want to send messages to to them and they perform
24:11
and they perform
24:11
and they perform something okay so I want to create a new
24:16
something okay so I want to create a new
24:16
something okay so I want to create a new actor how in the
24:18
actor how in the
24:18
actor how in the world can I do
24:20
world can I do
24:20
world can I do this so first off let me delete those
24:26
this so first off let me delete those
24:26
this so first off let me delete those this weather forecast controller
24:28
this weather forecast controller
24:28
this weather forecast controller nonsense and this one as
24:31
nonsense and this one as
24:31
nonsense and this one as well and let's rename this as uh my
24:36
well and let's rename this as uh my
24:36
well and let's rename this as uh my actors or
24:38
actors or
24:38
actors or actors
24:41
actors
24:41
actors controller my actors controller sounds
24:44
controller my actors controller sounds
24:44
controller my actors controller sounds better okay my actor's controller
24:48
better okay my actor's controller
24:48
better okay my actor's controller now let's create a new actor let's name
24:51
now let's create a new actor let's name
24:51
now let's create a new actor let's name it my actor and inside Dapper we have um
24:57
it my actor and inside Dapper we have um
24:57
it my actor and inside Dapper we have um a base class which is
25:00
a base class which is
25:00
a base class which is actor that comes from the doer. actors.
25:03
actor that comes from the doer. actors.
25:03
actor that comes from the doer. actors. r time name space so this is the one
25:06
r time name space so this is the one
25:06
r time name space so this is the one that I want to use
25:09
that I want to use
25:09
that I want to use okay and you need this Constructor the
25:14
okay and you need this Constructor the
25:14
okay and you need this Constructor the one that takes an actor host and passes
25:18
one that takes an actor host and passes
25:18
one that takes an actor host and passes the actor host to the base class to the
25:21
the actor host to the base class to the
25:21
the actor host to the base class to the base object okay speaking of which of
25:25
base object okay speaking of which of
25:25
base object okay speaking of which of course I can use the prime Constructor
25:29
course I can use the prime Constructor
25:29
course I can use the prime Constructor syntax which is so nice
25:33
syntax which is so nice
25:33
syntax which is so nice Okay and let's create something of
25:38
Okay and let's create something of
25:38
Okay and let's create something of course you want to model your own actors
25:41
course you want to model your own actors
25:41
course you want to model your own actors with behavior right they need to do
25:43
with behavior right they need to do
25:43
with behavior right they need to do something
25:45
something
25:45
something meaningful so that is the place where
25:48
meaningful so that is the place where
25:48
meaningful so that is the place where you're going to implement some kind of
25:50
you're going to implement some kind of
25:50
you're going to implement some kind of logic for example if you're
25:53
logic for example if you're
25:53
logic for example if you're building the shopping cart as an actor
25:57
building the shopping cart as an actor
25:57
building the shopping cart as an actor you need some kind of interface that you
26:01
you need some kind of interface that you
26:01
you need some kind of interface that you know includes the behavior that you want
26:04
know includes the behavior that you want
26:04
know includes the behavior that you want to implement such as ad product or I
26:08
to implement such as ad product or I
26:08
to implement such as ad product or I don't know return total or remove
26:11
don't know return total or remove
26:11
don't know return total or remove product and so
26:13
product and so
26:13
product and so on make sense so let's see my actor I
26:19
on make sense so let's see my actor I
26:19
on make sense so let's see my actor I want to keep it simple just an
26:23
want to keep it simple just an
26:23
want to keep it simple just an interface uh co-pilot is suggesting hey
26:27
interface uh co-pilot is suggesting hey
26:27
interface uh co-pilot is suggesting hey why don't you add a name uh I'm not sure
26:31
why don't you add a name uh I'm not sure
26:31
why don't you add a name uh I'm not sure to be honest so let's see
26:34
to be honest so let's see
26:34
to be honest so let's see public um I don't know task uh add
26:38
public um I don't know task uh add
26:38
public um I don't know task uh add something right add string or add State
26:42
something right add string or add State
26:42
something right add string or add State Okay add State string data and
26:47
Okay add State string data and
26:47
Okay add State string data and public uh task string get State and a
26:54
public uh task string get State and a
26:54
public uh task string get State and a string key or something could be
26:58
string key or something could be
26:58
string key or something could be data so what I'm doing here is I'm
27:02
data so what I'm doing here is I'm
27:02
data so what I'm doing here is I'm just implementing the behavior that I
27:04
just implementing the behavior that I
27:04
just implementing the behavior that I want for my actor right in this
27:07
want for my actor right in this
27:07
want for my actor right in this interface and of course I want to
27:09
interface and of course I want to
27:09
interface and of course I want to implement I my actor
27:12
implement I my actor
27:12
implement I my actor here and I'm ready to use those methods
27:17
here and I'm ready to use those methods
27:17
here and I'm ready to use those methods for doing
27:19
for doing
27:19
for doing something so take into account that the
27:23
something so take into account that the
27:23
something so take into account that the actor base class has some already
27:26
actor base class has some already
27:26
actor base class has some already pre-built proper properties and methods
27:29
pre-built proper properties and methods
27:29
pre-built proper properties and methods that you can use for instance if you
27:32
that you can use for instance if you
27:32
that you can use for instance if you type this you can use host for getting
27:37
type this you can use host for getting
27:37
type this you can use host for getting the host of this
27:39
the host of this
27:39
the host of this actor in other words where in the world
27:42
actor in other words where in the world
27:42
actor in other words where in the world this actor is running the ID a
27:46
this actor is running the ID a
27:46
this actor is running the ID a logger this is pretty cool because it's
27:48
logger this is pretty cool because it's
27:49
logger this is pretty cool because it's an N logger so you're not required to
27:51
an N logger so you're not required to
27:51
an N logger so you're not required to inject ilogger here in the primary
27:53
inject ilogger here in the primary
27:54
inject ilogger here in the primary Constructor
27:55
Constructor
27:55
Constructor anymore and we also have
27:58
anymore and we also have
27:58
anymore and we also have of this state manager property again you
28:03
of this state manager property again you
28:04
of this state manager property again you don't need to use uh the toer client
28:07
don't need to use uh the toer client
28:07
don't need to use uh the toer client object for sending the state can you see
28:11
object for sending the state can you see
28:11
object for sending the state can you see this so I'm just using the property that
28:14
this so I'm just using the property that
28:14
this so I'm just using the property that comes from the actor based class for
28:17
comes from the actor based class for
28:17
comes from the actor based class for storing the state and returning the
28:19
storing the state and returning the
28:19
storing the state and returning the state make
28:22
state make
28:22
state make sense okay now what in the world are we
28:26
sense okay now what in the world are we
28:26
sense okay now what in the world are we going to do this uh I'm we going to um
28:30
going to do this uh I'm we going to um
28:30
going to do this uh I'm we going to um do with this so let me I don't need a
28:34
do with this so let me I don't need a
28:34
do with this so let me I don't need a key or something I just want to return
28:36
key or something I just want to return
28:36
key or something I just want to return the state let me go ahead and implement
28:40
the state let me go ahead and implement
28:40
the state let me go ahead and implement this interface again and I'm going to
28:44
this interface again and I'm going to
28:44
this interface again and I'm going to use State manager and add or update um
28:49
use State manager and add or update um
28:49
use State manager and add or update um State asnc and I think this is fine or
28:53
State asnc and I think this is fine or
28:53
State asnc and I think this is fine or is this
28:54
is this
28:54
is this hallucinating no it it works actually
28:58
hallucinating no it it works actually
28:58
hallucinating no it it works actually so return
29:00
so return
29:01
so return this
29:03
this
29:03
this um so returning I think I'm going to use
29:07
um so returning I think I'm going to use
29:07
um so returning I think I'm going to use other AD State data
29:11
other AD State data
29:11
other AD State data data I think I'm relying too much on
29:15
data I think I'm relying too much on
29:15
data I think I'm relying too much on co-pilot these days right co-pilot is so
29:18
co-pilot these days right co-pilot is so
29:18
co-pilot these days right co-pilot is so cool but sometimes it hallucinates so
29:21
cool but sometimes it hallucinates so
29:21
cool but sometimes it hallucinates so I'm just using the at State Asing that
29:25
I'm just using the at State Asing that
29:25
I'm just using the at State Asing that comes from the state manager property um
29:28
comes from the state manager property um
29:28
comes from the state manager property um inside the actor based class and here as
29:31
inside the actor based class and here as
29:32
inside the actor based class and here as well right return State manager get
29:35
well right return State manager get
29:35
well right return State manager get state of type string this is a generic
29:38
state of type string this is a generic
29:38
state of type string this is a generic method and I'm passing the you know the
29:42
method and I'm passing the you know the
29:42
method and I'm passing the you know the state name this is just the
29:44
state name this is just the
29:44
state name this is just the key uh so you pass
29:47
key uh so you pass
29:47
key uh so you pass something right here and it's going to
29:49
something right here and it's going to
29:49
something right here and it's going to be stored in the state
29:52
be stored in the state
29:52
be stored in the state store right so this is a state
29:55
store right so this is a state
29:55
store right so this is a state management thing inside the actor
29:59
management thing inside the actor
29:59
management thing inside the actor okay cool now I'm ready to implement
30:03
okay cool now I'm ready to implement
30:03
okay cool now I'm ready to implement something for calling that actor you
30:07
something for calling that actor you
30:07
something for calling that actor you know that the virtual actor pattern is
30:09
know that the virtual actor pattern is
30:09
know that the virtual actor pattern is so cool because if an actor is not
30:11
so cool because if an actor is not
30:11
so cool because if an actor is not running it's not executing in that
30:14
running it's not executing in that
30:14
running it's not executing in that particular
30:15
particular
30:15
particular moment then it's going to be created
30:19
moment then it's going to be created
30:19
moment then it's going to be created just in time so it's so cool you don't
30:22
just in time so it's so cool you don't
30:22
just in time so it's so cool you don't need you don't need to worry about that
30:24
need you don't need to worry about that
30:24
need you don't need to worry about that um
30:25
um
30:25
um existence um so this is um suggesting
30:31
existence um so this is um suggesting
30:31
existence um so this is um suggesting some
30:32
some
30:32
some things let's see what's going on here
30:35
things let's see what's going on here
30:35
things let's see what's going on here this is suggesting injecting the actor
30:37
this is suggesting injecting the actor
30:37
this is suggesting injecting the actor proxy Factory and then create actor
30:41
proxy Factory and then create actor
30:41
proxy Factory and then create actor proxy of type I my actor I actually want
30:44
proxy of type I my actor I actually want
30:44
proxy of type I my actor I actually want to do this
30:46
to do this
30:46
to do this so uh let's see if I can save the code
30:52
so uh let's see if I can save the code
30:52
so uh let's see if I can save the code here so at state that is related with
30:56
here so at state that is related with
30:56
here so at state that is related with this HTTP Pole
30:59
this HTTP Pole
30:59
this HTTP Pole okay this is uh passing the actor ID
31:02
okay this is uh passing the actor ID
31:02
okay this is uh passing the actor ID from the
31:03
from the
31:03
from the body so far so good nothing fancy here
31:07
body so far so good nothing fancy here
31:07
body so far so good nothing fancy here just a regular um a spe of the core end
31:12
just a regular um a spe of the core end
31:12
just a regular um a spe of the core end point then it's going to create this
31:15
point then it's going to create this
31:15
point then it's going to create this actor by using Create actor proxy that
31:19
actor by using Create actor proxy that
31:19
actor by using Create actor proxy that comes from this object which is actor
31:23
comes from this object which is actor
31:23
comes from this object which is actor proxy
31:24
proxy
31:24
proxy Factory okay I believe you can can also
31:28
Factory okay I believe you can can also
31:28
Factory okay I believe you can can also use actor proxy
31:30
use actor proxy
31:30
use actor proxy itself and then use
31:33
itself and then use
31:33
itself and then use create without injecting actor actor
31:36
create without injecting actor actor
31:36
create without injecting actor actor proxy
31:37
proxy
31:38
proxy Factory uh take into account that you
31:40
Factory uh take into account that you
31:40
Factory uh take into account that you can also do that um I'm just following
31:43
can also do that um I'm just following
31:43
can also do that um I'm just following co-pilot suggestion here and then I'm
31:46
co-pilot suggestion here and then I'm
31:46
co-pilot suggestion here and then I'm going to pass the ID of the actor that I
31:49
going to pass the ID of the actor that I
31:49
going to pass the ID of the actor that I want to use in this case is the one that
31:53
want to use in this case is the one that
31:53
want to use in this case is the one that I'm receiving in the body and you need
31:56
I'm receiving in the body and you need
31:56
I'm receiving in the body and you need to pass the type
31:58
to pass the type
31:58
to pass the type so as you can see the actor type is just
32:00
so as you can see the actor type is just
32:00
so as you can see the actor type is just the
32:01
the
32:01
the name not the fully qualified name of the
32:05
name not the fully qualified name of the
32:05
name not the fully qualified name of the type meaning you have to remove the name
32:10
type meaning you have to remove the name
32:10
type meaning you have to remove the name spaces just the name so you can use this
32:14
spaces just the name so you can use this
32:14
spaces just the name so you can use this technique or you can also use name off
32:18
technique or you can also use name off
32:18
technique or you can also use name off right which is I think better because if
32:22
right which is I think better because if
32:22
right which is I think better because if I changed the name of my actor
32:26
I changed the name of my actor
32:26
I changed the name of my actor then the
32:28
then the
32:28
then the uh name of expression is going to be
32:31
uh name of expression is going to be
32:31
uh name of expression is going to be renamed as
32:33
renamed as
32:33
renamed as well so what's going on here uh create
32:38
well so what's going on here uh create
32:38
well so what's going on here uh create actor proxy expects I my
32:41
actor proxy expects I my
32:41
actor proxy expects I my actor and it's telling me he you know
32:45
actor and it's telling me he you know
32:45
actor and it's telling me he you know what I can't do this not possible why
32:51
what I can't do this not possible why
32:51
what I can't do this not possible why well it turns out that
32:54
well it turns out that
32:54
well it turns out that actors I mean your interfaces of the
32:57
actors I mean your interfaces of the
32:57
actors I mean your interfaces of the actor itself it depends on your
33:00
actor itself it depends on your
33:00
actor itself it depends on your implementation you need to implement I
33:04
implementation you need to implement I
33:04
implementation you need to implement I actor okay that comes from dber do
33:07
actor okay that comes from dber do
33:07
actor okay that comes from dber do actors as you can see here on the
33:09
actors as you can see here on the
33:09
actors as you can see here on the screen so I Implement I actor this is
33:12
screen so I Implement I actor this is
33:13
screen so I Implement I actor this is just a marker interface I believe this
33:15
just a marker interface I believe this
33:15
just a marker interface I believe this is empty as you can see here on the
33:19
is empty as you can see here on the
33:19
is empty as you can see here on the screen just a marker interface for
33:23
screen just a marker interface for
33:23
screen just a marker interface for expressing a you know what this
33:25
expressing a you know what this
33:25
expressing a you know what this interface that I'm creating is an actor
33:29
interface that I'm creating is an actor
33:29
interface that I'm creating is an actor no Behavior at
33:31
no Behavior at
33:31
no Behavior at all so I made my I my actor as an ey
33:37
all so I made my I my actor as an ey
33:37
all so I made my I my actor as an ey actor and that's
33:40
actor and that's
33:40
actor and that's it
33:43
okay so let
33:46
okay so let
33:46
okay so let me I haven't seen the private chat okay
33:50
me I haven't seen the private chat okay
33:50
me I haven't seen the private chat okay cool I'm connected I didn't uh check
33:55
cool I'm connected I didn't uh check
33:55
cool I'm connected I didn't uh check that at the beginning but of course
33:57
that at the beginning but of course
33:57
that at the beginning but of course we're running we're
33:59
we're running we're
33:59
we're running we're live Okay cool so I my actor is an i
34:03
live Okay cool so I my actor is an i
34:03
live Okay cool so I my actor is an i actor I'm creating an instance of that
34:06
actor I'm creating an instance of that
34:06
actor I'm creating an instance of that by using Create actor
34:08
by using Create actor
34:08
by using Create actor proxy and remember you can also use
34:11
proxy and remember you can also use
34:12
proxy and remember you can also use actor proxy actor proxy doc create and
34:15
actor proxy actor proxy doc create and
34:16
actor proxy actor proxy doc create and then pass I my actor and so on I believe
34:19
then pass I my actor and so on I believe
34:19
then pass I my actor and so on I believe this is another technique
34:23
this is another technique
34:23
this is another technique and in this uh case I'm using the actor
34:26
and in this uh case I'm using the actor
34:26
and in this uh case I'm using the actor proxy Factory speaking of which which
34:28
proxy Factory speaking of which which
34:28
proxy Factory speaking of which which let me use the primary Constructor
34:31
let me use the primary Constructor
34:31
let me use the primary Constructor syntax and it's just as as easy as you
34:36
syntax and it's just as as easy as you
34:36
syntax and it's just as as easy as you know at State calling the behavior of
34:39
know at State calling the behavior of
34:39
know at State calling the behavior of your
34:40
your
34:40
your actor remember that I created ad state
34:43
actor remember that I created ad state
34:43
actor remember that I created ad state right here in my
34:45
right here in my
34:45
right here in my interface where of course you can
34:47
interface where of course you can
34:47
interface where of course you can imagine hey add
34:49
imagine hey add
34:49
imagine hey add product remove product or calculate
34:54
product remove product or calculate
34:54
product remove product or calculate something or I don't know if it's a
34:57
something or I don't know if it's a
34:57
something or I don't know if it's a patient and um I don't know register
35:01
patient and um I don't know register
35:01
patient and um I don't know register movement that's important let's say that
35:04
movement that's important let's say that
35:04
movement that's important let's say that you're modeling some devices some iot
35:08
you're modeling some devices some iot
35:08
you're modeling some devices some iot kind of devices by using actors so you
35:11
kind of devices by using actors so you
35:11
kind of devices by using actors so you want to know the current state of things
35:14
want to know the current state of things
35:14
want to know the current state of things you can do that by using the actor uh
35:17
you can do that by using the actor uh
35:17
you can do that by using the actor uh implementation in
35:19
implementation in
35:19
implementation in Dapper um I don't know if you're using
35:22
Dapper um I don't know if you're using
35:22
Dapper um I don't know if you're using this for I think in the Orleans web page
35:26
this for I think in the Orleans web page
35:26
this for I think in the Orleans web page that I showed you
35:28
that I showed you
35:28
that I showed you um they mentioned that they were using
35:31
um they mentioned that they were using
35:31
um they mentioned that they were using the virtual actor pattern for Halo the
35:34
the virtual actor pattern for Halo the
35:34
the virtual actor pattern for Halo the video
35:35
video
35:35
video game right here for storing um I believe
35:41
game right here for storing um I believe
35:41
game right here for storing um I believe the scores or you know the state of the
35:44
the scores or you know the state of the
35:44
the scores or you know the state of the monsters and the state of the players
35:47
monsters and the state of the players
35:47
monsters and the state of the players when you were playing uh online with
35:51
when you were playing uh online with
35:51
when you were playing uh online with some with some people um they were using
35:54
some with some people um they were using
35:54
some with some people um they were using I don't know if that's true nowadays
35:57
I don't know if that's true nowadays
35:57
I don't know if that's true nowadays I I'm not sure if Halo exists anymore to
36:00
I I'm not sure if Halo exists anymore to
36:00
I I'm not sure if Halo exists anymore to be honest I I think so right anyway um
36:05
be honest I I think so right anyway um
36:05
be honest I I think so right anyway um so speaking of which just imagine
36:08
so speaking of which just imagine
36:08
so speaking of which just imagine modeling the state of the players you
36:11
modeling the state of the players you
36:11
modeling the state of the players you know the state of the monsters the state
36:13
know the state of the monsters the state
36:13
know the state of the monsters the state of the Machinery or the you know the the
36:18
of the Machinery or the you know the the
36:18
of the Machinery or the you know the the guns or so on right
36:20
guns or so on right
36:20
guns or so on right so that's that's why we have the actor
36:24
so that's that's why we have the actor
36:24
so that's that's why we have the actor implementation
36:26
implementation
36:26
implementation uh and that's one small
36:29
uh and that's one small
36:29
uh and that's one small example in other Enterprise applications
36:33
example in other Enterprise applications
36:33
example in other Enterprise applications such as hospitals and HR and so on you
36:37
such as hospitals and HR and so on you
36:37
such as hospitals and HR and so on you can Implement those entities as actors
36:41
can Implement those entities as actors
36:41
can Implement those entities as actors patients uh employees and so on anyway
36:46
patients uh employees and so on anyway
36:46
patients uh employees and so on anyway okay so far so good uh HTTP post with
36:49
okay so far so good uh HTTP post with
36:49
okay so far so good uh HTTP post with this actor
36:51
this actor
36:51
this actor ID and it's calling at State and it's
36:54
ID and it's calling at State and it's
36:54
ID and it's calling at State and it's not a surprise that this this is going
36:56
not a surprise that this this is going
36:56
not a surprise that this this is going to use the state
36:58
to use the state
36:58
to use the state management building
37:00
management building
37:00
management building block right that's why you need to have
37:05
block right that's why you need to have
37:05
block right that's why you need to have the ACT um
37:08
the ACT um
37:08
the ACT um support
37:11
support
37:11
support remember right
37:15
here state store this one actor state
37:19
here state store this one actor state
37:19
here state store this one actor state store you need to have it
37:22
store you need to have it
37:22
store you need to have it enable make
37:24
enable make
37:24
enable make sense beautiful this is a beautiful full
37:27
sense beautiful this is a beautiful full
37:27
sense beautiful this is a beautiful full implementation is so easy to understand
37:30
implementation is so easy to understand
37:30
implementation is so easy to understand I believe so get St I'm just receiving
37:34
I believe so get St I'm just receiving
37:34
I believe so get St I'm just receiving the actor
37:35
the actor
37:35
the actor ID maybe through the query string or
37:40
ID maybe through the query string or
37:40
ID maybe through the query string or something or the segments of uh of the
37:44
something or the segments of uh of the
37:44
something or the segments of uh of the URL and then you're using this actor ID
37:48
URL and then you're using this actor ID
37:48
URL and then you're using this actor ID for obtaining the
37:50
for obtaining the
37:50
for obtaining the actor let's change this to uh name off
37:55
actor let's change this to uh name off
37:55
actor let's change this to uh name off this is just retrieving can you see this
37:58
this is just retrieving can you see this
37:58
this is just retrieving can you see this line 23 this is just retrieving the
38:02
line 23 this is just retrieving the
38:02
line 23 this is just retrieving the actor
38:03
actor
38:03
actor itself and it's going to quiry the
38:06
itself and it's going to quiry the
38:06
itself and it's going to quiry the state and inside the implementation of
38:10
state and inside the implementation of
38:10
state and inside the implementation of that actor it's using again the state
38:13
that actor it's using again the state
38:13
that actor it's using again the state manage management component so far so
38:17
manage management component so far so
38:17
manage management component so far so good and this is just returning 200 and
38:19
good and this is just returning 200 and
38:20
good and this is just returning 200 and so far so
38:22
so far so
38:22
so far so good so is this going to
38:26
good so is this going to
38:26
good so is this going to work I believe so I think that's it
38:29
work I believe so I think that's it
38:29
work I believe so I think that's it before we do this we need to add the
38:33
before we do this we need to add the
38:33
before we do this we need to add the actors to your web
38:36
actors to your web
38:36
actors to your web API so you need to add some lines of
38:42
API so you need to add some lines of
38:42
API so you need to add some lines of code similar to the one that we use
38:45
code similar to the one that we use
38:45
code similar to the one that we use remember add
38:46
remember add
38:46
remember add Dapper but we don't use add Dapper
38:50
Dapper but we don't use add Dapper
38:50
Dapper but we don't use add Dapper here I believe you can but I'm going to
38:53
here I believe you can but I'm going to
38:53
here I believe you can but I'm going to show you uh Builder services at actors
38:57
show you uh Builder services at actors
38:57
show you uh Builder services at actors this is the method that you want to
39:00
this is the method that you want to
39:00
this is the method that you want to execute and then you want to pass that
39:04
execute and then you want to pass that
39:04
execute and then you want to pass that actor runtime
39:07
actor runtime
39:07
actor runtime options so this pattern is very um
39:12
options so this pattern is very um
39:12
options so this pattern is very um common in ASP core applications you pass
39:15
common in ASP core applications you pass
39:15
common in ASP core applications you pass the options object and here you can
39:19
the options object and here you can
39:19
the options object and here you can configure the thing in this case you
39:22
configure the thing in this case you
39:22
configure the thing in this case you know I want to register this
39:25
know I want to register this
39:25
know I want to register this actor which actor well my actor right
39:30
actor which actor well my actor right
39:30
actor which actor well my actor right the one that I created
39:31
the one that I created
39:32
the one that I created before you're just registering the actor
39:35
before you're just registering the actor
39:35
before you're just registering the actor in the
39:38
in the
39:38
in the infrastructure and I believe you can
39:40
infrastructure and I believe you can
39:40
infrastructure and I believe you can also uh use some other things if you
39:44
also uh use some other things if you
39:44
also uh use some other things if you want to tweak things a little bit here
39:48
want to tweak things a little bit here
39:48
want to tweak things a little bit here with Dapper but I believe this is enough
39:51
with Dapper but I believe this is enough
39:51
with Dapper but I believe this is enough and you can also go ahead
39:55
and you can also go ahead
39:55
and you can also go ahead and execute my actors
39:59
and execute my actors
39:59
and execute my actors handlers if you happen to be using
40:02
handlers if you happen to be using
40:02
handlers if you happen to be using that um you can be used to configure the
40:06
that um you can be used to configure the
40:06
that um you can be used to configure the end
40:07
end
40:07
end points so I believe this is
40:10
points so I believe this is
40:10
points so I believe this is required otherwise the actor proxy
40:14
required otherwise the actor proxy
40:14
required otherwise the actor proxy object is not going to be
40:16
object is not going to be
40:16
object is not going to be injected we can test that anyway I'm G
40:20
injected we can test that anyway I'm G
40:20
injected we can test that anyway I'm G to I'm going to use this map
40:23
to I'm going to use this map
40:23
to I'm going to use this map actors um handlers method right
40:28
actors um handlers method right
40:28
actors um handlers method right year amazing so I think we're ready to
40:33
year amazing so I think we're ready to
40:33
year amazing so I think we're ready to execute this
40:35
execute this
40:35
execute this so let's go back to the
40:38
so let's go back to the
40:38
so let's go back to the terminal let's go back to Dapper in
40:41
terminal let's go back to Dapper in
40:41
terminal let's go back to Dapper in action and then my
40:45
action and then my
40:45
action and then my actors and I want to use the State
40:48
actors and I want to use the State
40:48
actors and I want to use the State Management component that I have in my
40:50
Management component that I have in my
40:51
Management component that I have in my home folder I didn't create a component
40:54
home folder I didn't create a component
40:54
home folder I didn't create a component for this project I'm just realized on
40:57
for this project I'm just realized on
40:57
for this project I'm just realized on the default component right so dopper
41:02
the default component right so dopper
41:02
the default component right so dopper run just your regular D and
41:06
run just your regular D and
41:06
run just your regular D and R up
41:08
R up
41:08
R up ID let's name it actors or my
41:12
ID let's name it actors or my
41:12
ID let's name it actors or my actors and then uh dopper HTTP Port is
41:17
actors and then uh dopper HTTP Port is
41:17
actors and then uh dopper HTTP Port is going to be
41:19
going to be
41:19
going to be 55,000 app Port let's use
41:25
5500 and
41:28
5500 and
41:28
5500 and we have the ID we have the dopper HTTP
41:31
we have the ID we have the dopper HTTP
41:31
we have the ID we have the dopper HTTP Port we have the application Port of
41:33
Port we have the application Port of
41:33
Port we have the application Port of course I need to control that so net Ron
41:38
course I need to control that so net Ron
41:38
course I need to control that so net Ron and then URLs
41:41
and then URLs
41:41
and then URLs HTTP uh
41:43
HTTP uh
41:43
HTTP uh 55 and let's see what's going
41:46
55 and let's see what's going
41:46
55 and let's see what's going on so this is
41:52
running and if you see the messages you
41:55
running and if you see the messages you
41:55
running and if you see the messages you can see that the placement service is
41:58
can see that the placement service is
41:58
can see that the placement service is going to take um a bit of uh um job here
42:04
going to take um a bit of uh um job here
42:04
going to take um a bit of uh um job here I mean it's going to do some things
42:06
I mean it's going to do some things
42:06
I mean it's going to do some things because it's going to use the placement
42:11
because it's going to use the placement
42:11
because it's going to use the placement service for creating the actors and
42:13
service for creating the actors and
42:13
service for creating the actors and place them uh around in this case of
42:17
place them uh around in this case of
42:17
place them uh around in this case of course I'm dble uh I'm using my own
42:19
course I'm dble uh I'm using my own
42:19
course I'm dble uh I'm using my own machine here but this is actually what's
42:23
machine here but this is actually what's
42:23
machine here but this is actually what's happening um placement actress placement
42:26
happening um placement actress placement
42:26
happening um placement actress placement client
42:28
client
42:28
client many many many different messages I
42:30
many many many different messages I
42:30
many many many different messages I strongly suggest you go ahead and uh
42:33
strongly suggest you go ahead and uh
42:33
strongly suggest you go ahead and uh watch those
42:34
watch those
42:34
watch those messages
42:36
messages
42:36
messages um anyway I think we're ready to
42:40
um anyway I think we're ready to
42:40
um anyway I think we're ready to rumble I can execute drer list right
42:45
rumble I can execute drer list right
42:45
rumble I can execute drer list right this is
42:46
this is
42:46
this is running and I can use
42:50
running and I can use
42:50
running and I can use Curl or uh Postman let's reuse this
42:55
Curl or uh Postman let's reuse this
42:55
Curl or uh Postman let's reuse this one so my actors host address is going
42:58
one so my actors host address is going
42:58
one so my actors host address is going to be
43:00
to be
43:00
to be 5500 and my
43:03
5500 and my
43:03
5500 and my actors right so let's
43:07
actors right so let's
43:07
actors right so let's use this G and post my actors uh content
43:13
use this G and post my actors uh content
43:13
use this G and post my actors uh content type application
43:16
type application
43:16
type application Json
43:18
Json
43:18
Json data and we need the is that the data or
43:24
data and we need the is that the data or
43:24
data and we need the is that the data or what was the
43:25
what was the
43:25
what was the name this
43:28
name this
43:28
name this is yeah uh actor ID that comes
43:33
is yeah uh actor ID that comes
43:33
is yeah uh actor ID that comes from
43:36
from
43:36
from the
43:38
the
43:38
the um I I believe the segment right so I
43:42
um I I believe the segment right so I
43:42
um I I believe the segment right so I don't know 100 let's see if this works
43:46
don't know 100 let's see if this works
43:46
don't know 100 let's see if this works so send
43:49
so send
43:49
so send request uh enable to resolve service for
43:52
request uh enable to resolve service for
43:52
request uh enable to resolve service for type daer actur client so I'm going to
43:55
type daer actur client so I'm going to
43:55
type daer actur client so I'm going to use my own technique instead of using
43:59
use my own technique instead of using
43:59
use my own technique instead of using that let's go back here
44:03
that let's go back here
44:03
that let's go back here and let's let's just use the
44:08
and let's let's just use the
44:08
and let's let's just use the following so actor proxy Factory let's
44:12
following so actor proxy Factory let's
44:12
following so actor proxy Factory let's use uh actor
44:16
use uh actor
44:16
use uh actor proxy uh create and then I my actor I
44:21
proxy uh create and then I my actor I
44:21
proxy uh create and then I my actor I believe this can work
44:24
believe this can work
44:24
believe this can work um let's go back to the terminal
44:28
um let's go back to the terminal
44:28
um let's go back to the terminal let's execute
44:32
this so this is running let's go back
44:36
this so this is running let's go back
44:36
this so this is running let's go back here send oh
44:38
here send oh
44:38
here send oh no
44:41
no
44:41
no uh what's going
44:44
uh what's going
44:44
uh what's going on
44:48
5500 uh is that the
44:52
5500 uh is that the
44:52
5500 uh is that the other let me go back here and
44:58
other let me go back here and
44:58
other let me go back here and let's use actor proxy do create I'm
45:01
let's use actor proxy do create I'm
45:01
let's use actor proxy do create I'm using ad actors yes I'm using that and
45:05
using ad actors yes I'm using that and
45:05
using ad actors yes I'm using that and I'm also using uh map actors handlers
45:09
I'm also using uh map actors handlers
45:09
I'm also using uh map actors handlers anyway let me try this otherwise I'm
45:11
anyway let me try this otherwise I'm
45:11
anyway let me try this otherwise I'm going to show you the final version of
45:13
going to show you the final version of
45:13
going to show you the final version of this
45:14
this
45:14
this demo
45:16
demo
45:17
demo and yeah
45:18
and yeah
45:18
and yeah let's
45:20
let's
45:20
let's rebuild everything's rebuilding
45:23
rebuild everything's rebuilding
45:23
rebuild everything's rebuilding correctly
45:28
and let's do this let's try this
45:32
and let's do this let's try this
45:33
and let's do this let's try this again oh no something's wrong with this
45:36
again oh no something's wrong with this
45:36
again oh no something's wrong with this anyway I'm going to show you the
45:40
anyway I'm going to show you the
45:40
anyway I'm going to show you the other I already did this
45:44
other I already did this
45:44
other I already did this beforehand my
45:46
beforehand my
45:46
beforehand my actors
45:49
and so
45:54
Dapper let me go back here factors
45:59
Dapper let me go back here factors
45:59
Dapper let me go back here factors 55,000 it's just the
46:02
55,000 it's just the
46:02
55,000 it's just the same
46:04
same
46:04
same okay so this is
46:08
running and let me go back to my
46:12
running and let me go back to my
46:12
running and let me go back to my terminal since I want to show
46:15
terminal since I want to show
46:15
terminal since I want to show you
46:17
you
46:17
you the solution which is the same
46:25
one okay
46:28
one okay
46:28
one okay so
46:30
so
46:30
so um my
46:32
um my
46:32
um my actors get my actors in this case is uh
46:36
actors get my actors in this case is uh
46:36
actors get my actors in this case is uh simpler let's send a request and
46:39
simpler let's send a request and
46:39
simpler let's send a request and something's going on with my oh I know
46:43
something's going on with my oh I know
46:43
something's going on with my oh I know what's going
46:45
what's going
46:45
what's going on I believe I'm sending the the state
46:49
on I believe I'm sending the the state
46:49
on I believe I'm sending the the state and I already have the state that has
46:51
and I already have the state that has
46:51
and I already have the state that has the same key so reg is Commander
46:58
can you see
46:59
can you see
46:59
can you see this if I
47:06
um so nothing here nothing here and it's
47:14
um so nothing here nothing here and it's
47:14
um so nothing here nothing here and it's refusing
47:16
refusing
47:16
refusing uh what's going
47:19
uh what's going
47:19
uh what's going on is that because of topper
47:24
1.15 R is
47:27
1.15 R is
47:27
1.15 R is so this is
47:29
so this is
47:29
so this is running R is Commander this is
47:36
working there's something wrong with my
47:38
working there's something wrong with my
47:39
working there's something wrong with my Rus I
47:41
Rus I
47:41
Rus I believe
47:43
believe
47:43
believe H so the error is key not found
47:51
exception actor St of course of course
47:54
exception actor St of course of course
47:54
exception actor St of course of course it's giving me an error it makes sense
47:57
it's giving me an error it makes sense
47:57
it's giving me an error it makes sense right because because I haven't created
48:01
right because because I haven't created
48:01
right because because I haven't created the thing
48:02
the thing
48:03
the thing yet so let's create something and then
48:07
yet so let's create something and then
48:07
yet so let's create something and then yeah of course of course I'm just uh I
48:10
yeah of course of course I'm just uh I
48:10
yeah of course of course I'm just uh I was trying to understand why but of
48:12
was trying to understand why but of
48:12
was trying to understand why but of course I was trying to retrieve
48:15
course I was trying to retrieve
48:15
course I was trying to retrieve something that wasn't created well in my
48:18
something that wasn't created well in my
48:18
something that wasn't created well in my mind was created because I created this
48:20
mind was created because I created this
48:20
mind was created because I created this other project anyway let me show you
48:23
other project anyway let me show you
48:23
other project anyway let me show you this other
48:24
this other
48:24
this other implementation so this is the same
48:27
implementation so this is the same
48:27
implementation so this is the same I have my actor that has this
48:31
I have my actor that has this
48:31
I have my actor that has this Constructor I'm not using the primary
48:33
Constructor I'm not using the primary
48:33
Constructor I'm not using the primary Constructor syntax here and I have get
48:36
Constructor syntax here and I have get
48:36
Constructor syntax here and I have get data asnc and set data asnc and I'm just
48:40
data asnc and set data asnc and I'm just
48:40
data asnc and set data asnc and I'm just storing here right and I was trying to
48:43
storing here right and I was trying to
48:43
storing here right and I was trying to read something that was
48:47
read something that was
48:47
read something that was inexistent and here you can see that I'm
48:49
inexistent and here you can see that I'm
48:49
inexistent and here you can see that I'm using ACT proxy do create uh and then
48:53
using ACT proxy do create uh and then
48:53
using ACT proxy do create uh and then I'm using the same one here in get
48:57
I'm using the same one here in get
48:57
I'm using the same one here in get and I'm specifying hard a hardcoded
49:01
and I'm specifying hard a hardcoded
49:01
and I'm specifying hard a hardcoded actor ID I'm not receiving it's not that
49:05
actor ID I'm not receiving it's not that
49:05
actor ID I'm not receiving it's not that fancy right I'm just creating this ID
49:08
fancy right I'm just creating this ID
49:08
fancy right I'm just creating this ID and I'm retrieving the
49:11
and I'm retrieving the
49:11
and I'm retrieving the state and then in the first one here in
49:14
state and then in the first one here in
49:14
state and then in the first one here in the HTTP post I'm just setting the state
49:18
the HTTP post I'm just setting the state
49:18
the HTTP post I'm just setting the state hello dopper in
49:20
hello dopper in
49:20
hello dopper in action right so let's go back here and
49:24
action right so let's go back here and
49:24
action right so let's go back here and there there's something with my redit
49:26
there there's something with my redit
49:26
there there's something with my redit nevertheless yes um because this is
49:30
nevertheless yes um because this is
49:30
nevertheless yes um because this is failing you can see this here anyway D
49:34
failing you can see this here anyway D
49:34
failing you can see this here anyway D and R and let's try to uh execute this
49:40
and R and let's try to uh execute this
49:40
and R and let's try to uh execute this again
49:42
again
49:42
again so this is storing the state and then
49:44
so this is storing the state and then
49:44
so this is storing the state and then this is retrieving the state and this is
49:47
this is retrieving the state and this is
49:47
this is retrieving the state and this is actually the gist of
49:51
actually the gist of
49:51
actually the gist of actors I
49:53
actors I
49:53
actors I wonder I wonder if the previous impl
49:57
wonder I wonder if the previous impl
49:57
wonder I wonder if the previous impl mentation was correct and in my mind I
50:01
mentation was correct and in my mind I
50:01
mentation was correct and in my mind I was trying
50:02
was trying
50:02
was trying to uh read
50:05
to uh read
50:05
to uh read something that was
50:08
something that was
50:08
something that was uh not created so
50:11
uh not created so
50:11
uh not created so let's do this Dapper in
50:14
let's do this Dapper in
50:14
let's do this Dapper in action and my actors and I'm going to
50:19
action and my actors and I'm going to
50:19
action and my actors and I'm going to dopper
50:22
on okay and this is
50:25
on okay and this is
50:25
on okay and this is running and
50:29
and I want
50:33
to so in this other case I need to open
50:36
to so in this other case I need to open
50:36
to so in this other case I need to open that other um
50:39
that other um
50:40
that other um code hold on uh doer in action 11 and
50:47
code hold on uh doer in action 11 and
50:47
code hold on uh doer in action 11 and then my actors my actors
50:52
then my actors my actors
50:52
then my actors my actors solution and then
50:57
Okay cool so post this is the actor ID
51:02
Okay cool so post this is the actor ID
51:02
Okay cool so post this is the actor ID and this is of course
51:04
and this is of course
51:04
and this is of course content right and
51:07
content right and
51:07
content right and then data data is the
51:12
then data data is the
51:12
then data data is the state so let's go back here and
51:17
state so let's go back here and
51:17
state so let's go back here and say data it's going to be
51:20
say data it's going to be
51:20
say data it's going to be hey
51:22
hey
51:22
hey oh
51:24
oh
51:24
oh send no there's something wrong with
51:26
send no there's something wrong with
51:26
send no there's something wrong with actual proxy Factory anyway the other um
51:31
actual proxy Factory anyway the other um
51:31
actual proxy Factory anyway the other um source code is working right
51:34
source code is working right
51:34
source code is working right now and this is actually the same that I
51:38
now and this is actually the same that I
51:38
now and this is actually the same that I wanted to show you
51:40
wanted to show you
51:40
wanted to show you today and and remember I'm just using
51:44
today and and remember I'm just using
51:44
today and and remember I'm just using actor proxy do create instead of
51:46
actor proxy do create instead of
51:46
actor proxy do create instead of injecting that other actor proxy um
51:51
injecting that other actor proxy um
51:51
injecting that other actor proxy um which I believe it has to work somehow
51:54
which I believe it has to work somehow
51:54
which I believe it has to work somehow I'm missing some kind of configuration
51:56
I'm missing some kind of configuration
51:56
I'm missing some kind of configuration here anyway this is working this is just
51:59
here anyway this is working this is just
51:59
here anyway this is working this is just those are the actors implemented by
52:04
those are the actors implemented by
52:04
those are the actors implemented by Dapper and
52:07
Dapper and
52:07
Dapper and I I think we're ready to say goodbye
52:11
I I think we're ready to say goodbye
52:11
I I think we're ready to say goodbye today
52:13
today
52:13
today so I'm your host Rodrigo this was the
52:18
so I'm your host Rodrigo this was the
52:18
so I'm your host Rodrigo this was the actors session with Dapper you can see
52:22
actors session with Dapper you can see
52:22
actors session with Dapper you can see that this is very powerful of course I
52:25
that this is very powerful of course I
52:25
that this is very powerful of course I just scratched the the surface okay I
52:29
just scratched the the surface okay I
52:29
just scratched the the surface okay I strongly suggest if you're interested in
52:31
strongly suggest if you're interested in
52:31
strongly suggest if you're interested in actors of course you can go ahead and
52:34
actors of course you can go ahead and
52:34
actors of course you can go ahead and navigate to the dopper
52:36
navigate to the dopper
52:36
navigate to the dopper documentation but this is actually it
52:39
documentation but this is actually it
52:39
documentation but this is actually it this is the gist you create those
52:41
this is the gist you create those
52:41
this is the gist you create those objects that represent some kind of
52:44
objects that represent some kind of
52:44
objects that represent some kind of entity they have state you send messages
52:47
entity they have state you send messages
52:47
entity they have state you send messages to them you don't have to worry about
52:49
to them you don't have to worry about
52:49
to them you don't have to worry about the infrastructure and the messaging
52:51
the infrastructure and the messaging
52:51
the infrastructure and the messaging Dapper is going to take care of that for
52:54
Dapper is going to take care of that for
52:54
Dapper is going to take care of that for you and yeah actors are fantastic and so
52:59
you and yeah actors are fantastic and so
52:59
you and yeah actors are fantastic and so clean the implementation is so clean and
53:01
clean the implementation is so clean and
53:01
clean the implementation is so clean and so powerful uh congratulations to the
53:04
so powerful uh congratulations to the
53:04
so powerful uh congratulations to the entire dopper team for doing
53:07
entire dopper team for doing
53:07
entire dopper team for doing this okay okay okay
53:09
this okay okay okay
53:09
this okay okay okay sarac hi my
53:12
sarac hi my
53:12
sarac hi my friend so this is your host I'm Rodrigo
53:15
friend so this is your host I'm Rodrigo
53:15
friend so this is your host I'm Rodrigo and see you next week okay take care
53:21
[Music]
#Programming
#Software


