0:00:25
what is going on guys welcome back to
0:00:27
another session of
0:00:29
and fix show brought to you by
0:00:32
the raw coders yes that's us
0:00:39
wondering there's only um
0:00:43
which is me at the moment um so we have
0:00:46
a new person joining in
0:00:49
um and here he is so
0:00:52
let's give a huge welcome to tory
0:01:07
um your picture is a bit frozen which is
0:01:12
see you or hear you
0:01:20
all right i think you might be having
0:01:22
some technical problems for the internet
0:01:25
so yeah you can get back on
0:01:42
i think we lost power so i'm hoping it's
0:01:44
gonna come back on otherwise it's gonna
0:01:48
right right i see what you mean
0:01:51
yeah probably just one of those things
0:01:53
that is is an essential need but i'm
0:01:57
just good that we have you um so for
0:02:00
those of you who don't know
0:02:02
dory he's been a really regular
0:02:06
viewer for role wrong
0:02:10
and also contributed pretty
0:02:13
much a lot to the project as well um
0:02:16
really good developer slash a person as
0:02:23
the reason why he's here is because i'm
0:02:28
on uh a bit of a break and he will be
0:02:32
returning back say on the 11th of jan
0:02:36
and i thought they might be a good idea
0:02:46
sounded really excited so he's here now
0:02:52
so now that that is over with um
0:02:56
let's do the acknowledgements
0:02:59
and then we can get the ball rolling
0:03:07
i begin today by acknowledging the
0:03:09
traditional custodians of the land on
0:03:11
which we gather today and pay my
0:03:13
respects to the elders past present and
0:03:16
future i extend their respect to
0:03:18
aboriginal and torres strait islander
0:03:27
yeah so i don't really
0:03:30
know if you if i should ask you this
0:03:33
question because you have been on this
0:03:39
as as in a contributor and as
0:03:43
uh as a special guest but how do you
0:03:50
a new raw coders member
0:04:02
that's that's really that's really kind
0:04:04
of you because like this is
0:04:06
this is i like this is not my project
0:04:09
this is your project and
0:04:12
then it was yours in critiques project
0:04:18
the three of you with dinesh
0:04:20
and so that's that's really kind of you
0:04:23
man i really appreciate it
0:04:25
now man thanks for the awesome
0:04:27
introduction too that was really cool
0:04:30
um it's fun play your man and yeah it's
0:04:34
really good to have you as in on this
0:04:37
stream as well because we personally
0:04:40
learn a lot from your javascript
0:04:47
especially a lot and plus them
0:04:50
you you've got some amazing weather
0:04:53
knowledge in diamond db so that's been
0:04:58
thank you very m very much and that
0:05:06
forward in to the action so a bit of a
0:05:10
recap um so what we did yesterday today
0:05:14
was we managed to get the board by name
0:05:23
part where it was getting all the
0:05:30
which was the board note so
0:05:33
we were getting the board id and the
0:05:35
board name but not the board notes
0:05:44
few things but they
0:05:47
didn't didn't really work out so i
0:05:49
continued off to this stream and
0:05:54
get that working and
0:05:57
considering the missing part was the
0:06:00
attribute that i was talking about in
0:06:05
that was the key as into
0:06:08
for that to be working um so i'll just
0:06:13
my screen and take you through the
0:06:18
um i don't know how much it would help
0:06:21
it's always good to
0:06:23
see what the root cause was and what we
0:06:32
should be able to steam my screen
0:06:44
um i'm just gonna have to keep an eye on
0:06:50
i think i might need to give you access
0:06:54
surface so you can help us out and keep
0:07:00
channel while i'm sharing my sm my my
0:07:03
screen but we can do that um after this
0:07:09
sure i can see that um
0:07:18
keep an eye on that as well that'd be
0:07:24
all right perfect so the
0:07:28
missing um part that
0:07:32
um i added and it were
0:07:35
started working was
0:07:40
non-key attributes
0:07:43
and then the board notes
0:07:45
uh this is basic basically the column
0:07:48
though i had to add and
0:07:55
change the projection type to in include
0:07:58
which basically says that have all this
0:08:02
board id and board name
0:08:10
non key attributes as well yeah
0:08:13
gotcha so that was that was the that was
0:08:24
i'll just test it and by the way i've
0:08:27
already added you to the postman team
0:08:31
oh yeah i got that thank you
0:08:35
all right so if we get all the boards
0:08:42
this is our how many boards have we got
0:08:44
at the moment three so if we do t2
0:08:49
if you want to get this one
0:08:52
actually i'll do t3 now
0:08:56
and it should give me the bold notes as
0:09:03
and if i do t2 then it would give me
0:09:06
this one t2 and if i do t1 it would give
0:09:09
me that one at all
0:09:14
so now that's all done
0:09:19
do you think about this tutorial looking
0:09:24
looks good to me that's great that's
0:09:29
yeah yeah that's choosing the
0:09:33
gsi the board name cool
0:09:37
thank you i mean it wouldn't have been
0:09:41
without as in your
0:09:47
your your kind of really good good
0:09:49
knowledge of dynamo
0:09:52
dbs which actually included the dsi and
0:09:55
i think that was your idea
0:09:58
isn't it to use the gsi for this use
0:10:04
i don't know maybe but
0:10:07
um it's nice that it's working and
0:10:09
luckily i took those certain
0:10:12
certifications that's how i get
0:10:15
that's how i learned enough about
0:10:19
yeah i mean those certifications really
0:10:27
when you're learning but when a real
0:10:30
voter application as in practice comes
0:10:35
then you should say oh so this yeah i
0:10:38
learned this one oh now i can use that
0:10:43
yeah pretty much so
0:10:50
all right cool so now that that is done
0:10:54
um the next step we need to be
0:10:57
working on is integrating socket io
0:11:04
worked with this socket i o before as
0:11:11
i think i've done it once a long time
0:11:13
ago um but it's all right it's pretty
0:11:16
good easy library to work with
0:11:20
right right right see like the preferred
0:11:26
all right now for javascript
0:11:31
so what does it do though
0:11:34
uh it just it just helps you more easily
0:11:37
work with web sockets
0:11:39
it's just like a really easy to use like
0:11:41
websocket like api with i guess like
0:11:46
you know instead of
0:11:48
coding a lot of extra
0:11:50
maybe features you would have in your
0:11:52
your websocket application like you know
0:11:54
just has a lot of stuff baked in for you
0:11:58
ah okay right right right i see
0:12:01
i see yeah that makes a lot of sense
0:12:05
because what i so i did a bit of
0:12:08
research on that one and from what i
0:12:11
kind of understood
0:12:12
is that basically it's used if you want
0:12:18
in multiple places
0:12:21
the same time so multiple users can
0:12:24
access the app and work on this
0:12:28
yep yeah that's um
0:12:32
the use case for web sockets is using
0:12:35
doing like uh you know anything real
0:12:39
you know where you have multiple
0:12:41
multiple users using like the same game
0:12:44
or in this case a board
0:12:50
yeah yeah that would actually make sense
0:12:53
and that would be the as in
0:12:58
core of what we want to do
0:13:01
now moving forward
0:13:05
all right so i'll just create this
0:13:07
encryption um implement
0:13:14
actually integrate use
0:13:18
implement actually use socket
0:13:32
a board simultaneously
0:13:39
let's see you can get this
0:14:03
wow this is really challenging my
0:14:08
all right here we go
0:14:09
we got there at the end
0:14:11
um enable multiple use to access the
0:14:14
board simon tennessee and
0:14:29
yeah yeah that should be fine
0:14:34
okay cool so now what do we have to do
0:14:37
actually i might just add
0:14:41
i'm gonna have to add you to our jira
0:14:52
so how do we do this because i haven't
0:14:55
actually worked with
0:14:57
i am before at all whatsoever
0:15:03
does this is this project is this
0:15:05
project already using websockets
0:15:08
um it was but due to the functionality
0:15:11
that we wanted to do we kind of disabled
0:15:18
that would be where we want to start off
0:15:24
uh sure do you know where it is
0:15:29
know yeah it's in the front end
0:15:36
so it was in the script
0:15:42
socket oh here we go so
0:15:52
oh they were using socket i o too
0:15:58
yeah it's like james it's like it's been
0:16:00
around for a long time it's very solid
0:16:04
all right tractor i say
0:16:11
um i'm just thinking how to approach
0:16:21
do you have any suggestions how to
0:16:25
are you on are you on your own script
0:16:32
this is the part that
0:16:42
socket send message so
0:16:46
a reference action has happened send it
0:16:48
to the server well the the first thing
0:16:51
the first thing that needs to happen is
0:16:54
is the connection to the socket
0:17:00
but here's here's a tricky part usually
0:17:04
a websocket requires a server
0:17:12
honestly i've never
0:17:14
i've i've actually
0:17:19
websockets with a service called pusher
0:17:22
but i haven't done serverless websockets
0:17:26
uh socket io or any web sockets in
0:17:29
general so i imagine that might be a
0:17:32
more challenging because you the way
0:17:36
i don't know that much about websockets
0:17:38
to be honest like i've forgotten a lot
0:17:40
about the implementation
0:17:42
like how it actually works
0:17:48
essentially you have a you have a server
0:17:54
instead of instead of making like you
0:18:03
post requests to the server well the
0:18:08
opens up a websocket connection and the
0:18:10
server also accepts
0:18:13
that websocket connection and then
0:18:16
after the after the connection is made
0:18:23
instead of it being like one-way data
0:18:25
it's like it's like open connection
0:18:27
where they're pinging and pawning each
0:18:28
other and sending data that way so that
0:18:31
way it's like real time and you don't
0:18:34
reopening these connections
0:18:39
um would it be and
0:18:45
do you maybe you want to share your
0:18:49
use draw door i o to
0:18:53
i can try and my my drawing is going to
0:18:56
be terrible though i trust
0:19:02
mine is the same as swell but as long as
0:19:06
it can convey the message that should be
0:19:12
or yeah i'm gonna i think i'm gonna i
0:19:15
think i'm probably gonna find somebody's
0:19:17
websocket diagram just to steal
0:19:21
okay yeah i mean this this will probably
0:19:24
this pro this will probably
0:19:26
actually um web socket
0:19:32
because they'll they'll do oh yeah and
0:19:34
it explains a lot more things than i can
0:19:37
understand websockets
0:19:46
if you want i can share my screen or you
0:19:54
let me share my screen i'll do my best
0:19:58
yes all right take your time
0:20:03
second button from the right
0:20:08
third one sorry ah here we go i can see
0:20:11
yours and yours is up
0:20:17
so i wish i wish there was one where
0:20:20
there's multiple clients
0:20:22
oh well yeah this works
0:20:24
this works maybe not
0:20:26
whoever made this like sorry but it's
0:20:29
yeah it looks like pretty
0:20:31
pretty good um diagram actually
0:20:34
so basically uh you would have you have
0:20:37
multiple users right
0:20:42
and then you know they're all connected
0:20:43
through the internet
0:20:47
i don't think this this part over here
0:20:49
is not really that important honestly
0:20:52
but um basically you have a server
0:20:55
which is like you know an ec2 instance
0:20:59
um except the one challenge is the
0:21:03
application you have is serverless
0:21:06
but let's let's say this whole system
0:21:08
right here just to make it like
0:21:11
more simple and dumb is the whole server
0:21:13
right it's just one unit okay
0:21:17
so basically the client will connect to
0:21:19
the server and then on there like if
0:21:22
you're using socket io you have a client
0:21:25
um you have some client
0:21:28
api but there's also a server api that
0:21:31
so on on your server you'd have socket i
0:21:34
o also running as this as the socket io
0:21:37
server and it will it will look for
0:21:40
um it will look for those client
0:21:43
requests to connect to the websocket
0:21:45
like on a specific address
0:21:48
and then if it if if the server accepts
0:21:51
it then there's like
0:21:56
this see this this happens where you
0:22:00
have this this handshake and then
0:22:01
there's a connection opened
0:22:05
no don't validate my browser
0:22:08
yeah you have this you have this
0:22:12
and then and then okay like we agreed to
0:22:15
connect the connections open and now you
0:22:17
have this open and persistent connection
0:22:20
that's bi-directional
0:22:22
so that's like that's how like the
0:22:24
real-time stuff happens because you
0:22:26
don't need to keep like
0:22:28
sending you know like get me this post
0:22:31
and then i'm going to post you this and
0:22:33
then also like the challenge would be
0:22:35
if if if there's let's imagine there's
0:22:38
two users like right there's two phones
0:22:41
like they could send data to the server
0:22:43
but how does this how does the server
0:22:46
then send data back to
0:22:49
the other user without the other user
0:22:51
basically like polling the requests
0:22:56
so that's that's what websockets kind of
0:22:58
does in a in a nutshell
0:23:03
the one problem is is you notice the
0:23:08
now the problem with the
0:23:11
this is i'm sure there's a
0:23:13
a way around it but
0:23:16
because everything is is serverless it's
0:23:18
running inside of a lambda function
0:23:24
problem is that lambda function can only
0:23:26
execute for what like 15 minutes
0:23:31
something like that before it
0:23:33
yeah all right i say so um
0:23:38
after 15 minutes then
0:23:40
something needs to happen
0:23:43
um where the client would have to like
0:23:51
server but like the yeah i don't
0:23:53
honestly i'd have to read about how that
0:23:55
would work in a serverless environment
0:23:57
i'm sure it can be done i just don't
0:24:02
let's do a bit of research together um
0:24:19
is diamond feasible
0:24:21
for new website gateway endpoint ah
0:24:28
so it needs to be a separate endpoint
0:24:34
can i use web sockets in
0:24:37
aws unless you build your business logic
0:24:40
uses http based backend such as
0:24:48
or the hp endpoint before you begin a
0:24:51
couple of concepts of websocket api in
0:24:54
api gateway all right so we can
0:24:57
basically choose the websocket api in
0:25:04
the first is a new resource called a
0:25:10
how to enable websockets
0:25:13
okay hang on i would have to go back and
0:25:18
and understand the concept of
0:25:22
i don't know why i'm
0:25:24
skipping steps which shouldn't be
0:25:50
sure yeah there's a lot of great ones
0:25:53
what i'm gonna do is i'm gonna
0:25:56
stop sharing my screen
0:25:59
for a minute and then start again
0:26:05
i'll send you this in the chat too yes
0:26:07
this is this is gonna help us so much i
0:26:11
found this on aws they have an example
0:26:13
of a simple chat app
0:26:16
a serverless environment so it's
0:26:37
a beginner's guide to web socket
0:26:45
okay cool i've got the
0:26:49
i've got your link and
0:26:52
let's check what do we get from there
0:27:00
start sharing my screen now
0:27:10
announcing web sockets apis in here and
0:27:14
okay so historically
0:27:17
we actually required setting up fleets
0:27:22
that were responsible for managing the
0:27:28
positive questions
0:27:37
you can use bi-directional
0:27:39
communication applications using
0:27:52
manage any service
0:27:55
yeah that's actually really exciting
0:28:00
so we don't even have to
0:28:05
any servers or managing manager
0:28:18
user request and response
0:28:21
your mod will be the client sending a
0:28:23
request to a service and the service
0:28:26
responded synchronously back to the
0:28:30
the websockets apis are
0:28:33
bi-directional in nature this means that
0:28:36
the client can send
0:28:38
messages to a res to a service and
0:28:41
services can independently send messages
0:28:46
right okay right right right
0:28:50
clone can send the message to a service
0:28:54
and then the services can independently
0:28:56
send messages to his client
0:29:00
the bi-directional behavior
0:29:03
allows for richer types of
0:29:10
interaction because the service can push
0:29:17
needing to make an explicit
0:29:26
with the websockets api are often used
0:29:29
in real time such as chat okay yeah
0:29:34
um the police explain how to build a
0:29:36
serverless real-time chat application
0:29:40
all right cool so when you
0:29:43
request saying please of course if
0:29:45
you're responsible for managing your own
0:29:49
now the api gateway
0:29:54
get with this is no longer necessary
0:29:57
uh it lets you build your business logic
0:30:03
backhands such a yeah we have that
0:30:06
so we can just use this
0:30:14
here a couple of concepts of
0:30:19
api in api gateway the first is a new
0:30:23
resource type called the root
0:30:28
i would describe how api gave should
0:30:31
handle the particular
0:30:34
type of client request
0:30:36
so in our case the rule would probably
0:30:55
and includes a rookie parameter of value
0:30:59
that that you provide to identify the
0:31:03
or websockets is composed of one or more
0:31:08
to determine which route particular
0:31:10
inbound request should use
0:31:14
provide a reflection
0:31:17
wow this is a lot to absorb at the
0:31:26
and their expression is evaluated
0:31:29
against an inbound request
0:31:59
oh um did something happen
0:32:03
yeah i got i got booted somehow i don't
0:32:05
know what happened
0:32:10
yeah i was just saying they're reading
0:32:13
this there are a lot of concepts to
0:32:18
i mean that having this has a brand new
0:32:21
yeah probably it's probably not
0:32:23
something we can just
0:32:26
jump into no way no no
0:32:32
but i'm really enjoying the learning
0:32:34
curve that i'm having at the moment
0:32:37
yeah and the cool thing is once you can
0:32:40
like a chat app or
0:32:43
you know this this
0:32:44
like kanban board then it's like the the
0:32:48
concept is is the same like you would
0:32:50
you would you would do this for any
0:32:52
real-time app which is which is nice so
0:32:55
it is it is a cool thing to learn
0:33:00
yeah i couldn't agree more
0:33:06
the expression is evaluated against okay
0:33:11
in the rookie the free special
0:33:15
the free special root key values that
0:33:18
api gateway allows you to
0:33:20
use for root default okay
0:33:23
that's fine so build a serverless
0:33:27
real-time chat application okay
0:33:30
so these are clients so
0:33:32
basically this is the board and all
0:33:35
these users are interacting with the
0:33:39
all right so everything as in all the
0:33:43
all the infrastructure has to be
0:33:54
yeah it has to be handled handled on the
0:33:56
on the server side
0:33:58
right right right right i say
0:34:01
so on the client side yeah oh so
0:34:08
what was being apparently done
0:34:10
and that you i think it was being
0:34:21
uh script.js is a client side
0:34:26
okay yeah yeah so you will
0:34:28
like with the websocket
0:34:30
on the client you will have
0:34:32
you will have a more simpler
0:34:39
like so you have a client-side socket
0:34:42
that the client knows how to connect to
0:34:44
the websocket on the server side and
0:34:46
then basically like
0:34:49
when to send messages and like how to
0:34:51
receive and like update messages in the
0:34:57
um so actually like the the client side
0:35:00
it's not it's not super complex and then
0:35:03
the server side i guess is also not
0:35:05
super complex either you're just like
0:35:07
basically you're just managing pools of
0:35:10
connections from the clients and
0:35:12
basically saying like
0:35:14
hey you guys are one
0:35:17
you guys are a board so like
0:35:19
you guys all get pulled together and
0:35:21
then like whatever happens to this board
0:35:24
like this id then like
0:35:27
i'm gonna send uh send updates to any of
0:35:31
the clients connected to the websocket
0:35:34
so that everybody can see everything in
0:35:38
and then because you have that client
0:35:42
connection already uh set up then the
0:35:45
client already just listens
0:35:47
it just listens for any incoming
0:35:50
um any incoming messages from the server
0:35:54
side and as you saw it's it's it's
0:35:56
persistent and it's bi-directional so
0:35:59
like instead of like
0:36:01
you know those typical http um to get
0:36:07
get requests and stuff like yeah yeah
0:36:10
it just happens like in both directions
0:36:17
yeah totally yeah yeah i don't know
0:36:21
myself that well but i just remember the
0:36:23
concept like but like it's like it's
0:36:26
it's like a different i forget like the
0:36:30
the type of connection and stuff like
0:36:32
that and how it like really really works
0:36:35
like under the hood but yeah it's like
0:36:41
a little bit different of a concept than
0:36:45
traditionally work with like api
0:36:49
right right yeah and that makes total
0:36:52
sense what you said and then that is
0:36:55
basically the use case of the
0:37:00
and when you as in the web sockets that
0:37:03
that how you want to
0:37:05
use that but one thing that couldn't
0:37:08
really understand that do you need to
0:37:11
um so if you want to use websockets do
0:37:15
create a stock on the client side and on
0:37:18
the server side is it
0:37:21
um so the client will have basically an
0:37:24
end point like a socket endpoint oh okay
0:37:28
right so you can you can pretty much
0:37:30
think of it like a http endpoint except
0:37:32
it looks slightly different like
0:37:34
i don't remember how socket io handles
0:37:40
i think it starts with w
0:37:42
sl let's check it out
0:37:47
right right right i
0:37:51
and that's how the that's how the client
0:37:54
connects to the server and then the
0:37:56
server is actually
0:38:01
that's how the that's how the uh
0:38:04
the client and the server actually
0:38:08
instead of like typical http like
0:38:11
requests to a particular endpoint
0:38:15
um but if i sent you a link in the chat
0:38:19
if you go to the example section you'll
0:38:26
actually initializes a connection with a
0:38:29
server and in this example it's just
0:38:33
but essentially it's the same thing
0:38:35
like it would be whatever
0:38:39
api gateway endpoint
0:38:44
connection opens so it sends
0:38:47
a hello server and then
0:38:50
then it listens from
0:38:52
for the messages from the server
0:38:55
exactly right for our tracker and you
0:38:58
see how it starts with ws
0:39:00
yeah like the special websocket like
0:39:10
that's basically what you do on the
0:39:13
you open the connection
0:39:15
at that specific address and then
0:39:20
uh then you can listen for
0:39:23
events like messages or whatever it's
0:39:25
coming from the server and then you can
0:39:27
have another list like another
0:39:30
um another method basically to send
0:39:32
messages to the server so like when you
0:39:36
when you update a card
0:39:40
or whatever you're doing in real time
0:39:50
looking really interesting and fun
0:39:54
yeah this is like i like the real time
0:39:56
stuff it's really cool like i haven't
0:39:58
gotten to do so much of it but like when
0:40:00
i do i'm always i'm always amazed like
0:40:06
the more we do the more we find out that
0:40:09
there's more to learn as well which is
0:40:11
just oh yeah this is just fantastic
0:40:15
yeah this is this is a good this is a
0:40:17
this is a great challenge though i like
0:40:20
yeah yeah true true
0:40:29
websockets for it from aws
0:40:36
to understand how you can use the new
0:40:38
website here patreon i'll show you build
0:40:43
showing and it will include the
0:40:50
chat room and as they connect to
0:40:55
so basically in our project you would be
0:41:00
the users join the board
0:41:04
connect right right and the back end can
0:41:09
and the backend can send messages to
0:41:15
that is provided after these users
0:41:19
after the use is connected
0:41:23
website page users can can send messages
0:41:30
disconnected clients are removed from
0:41:36
i'm i'm gonna definitely enjoy this
0:41:46
work is that i will
0:41:49
wrap so i will our front end will be
0:41:53
communicating back and forth
0:41:56
so it would essentially be about that
0:41:59
rational connection and communication
0:42:16
create websocket api first
0:42:23
however if we check how to create a
0:42:29
create a web socket
0:42:36
if you if you if you look at the example
0:42:38
too there is a there is a repo for this
0:42:41
project there's a link
0:42:44
right before create a new websocket so
0:42:47
i'm i'm hoping they even have the the
0:42:49
sam template in there the yaml
0:42:53
i don't know see the github repo yeah
0:42:58
i really hope they do because that will
0:43:15
that's awesome man i'm so bad at these
0:43:18
uh these ammo files
0:43:24
wouldn't say you're really bad but um
0:43:29
gmo it gets really fussy as in
0:43:33
even if you have once
0:43:36
one space and it's not it's not it's not
0:43:40
supposed to be there it won't compile
0:43:48
these guys are really fussy
0:43:55
so this is the api getting
0:43:58
gateway to so this is the simple chair
0:44:02
websocket how many has he got
0:44:07
so simple chair websocket
0:44:14
which is for connection
0:44:18
rookie and then connect
0:44:22
oh so it's got the overall
0:44:29
and then it's got the
0:44:32
roots which is just from
0:44:36
operation name connect join integrations
0:44:46
and then it's called
0:44:47
simple chain integration proxy
0:44:52
and uh so it's actually given the lambda
0:44:58
uh disconnect root
0:45:01
disconnect integrations
0:45:03
centers and integration
0:45:16
dude i think i'm gonna have to watch a
0:45:19
proper youtube tutorial on this i'm not
0:45:22
i'm definitely well i am i'm so bad at
0:45:26
reading these template files
0:45:28
too because i haven't worked enough
0:45:31
really know everything i'm looking at
0:45:40
conventions are making
0:45:43
sense and it's kind of all right as in
0:45:49
some kind of logic as in what exactly is
0:45:52
happening but as you go
0:45:58
and deeper the logic keeps on increasing
0:46:01
and you kind of forget the previous
0:46:03
logic of what was happening
0:46:06
and i'm like okay i need to walk i need
0:46:08
to actually take my time on this
0:46:12
yeah this these cloud formation
0:46:15
templates and sam templates are so
0:46:20
so cool because you can just like launch
0:46:24
exactly like you launch a whole stack
0:46:29
but yeah i'm just not i'm not good at
0:46:31
reading them i'm not good at building
0:46:34
and you're not the only one man i think
0:46:38
it takes it takes practice yeah
0:46:45
oh looks like what's like the dynamo
0:46:48
what is the dynamo db doing in there
0:46:58
storing what is it doing with the
0:47:04
is it storing the messages
0:47:08
well back in the diagram
0:47:11
according to the diagram it
0:47:13
it helps um it facilitates a connection
0:47:20
or what's on connect is on connect the
0:47:25
i think it's a connection between
0:47:35
as in do this when it's been connected
0:47:39
so basically i think what i'm
0:47:41
understanding that
0:47:43
soon as it gets a new
0:47:45
user has been connected to the
0:47:50
through chat room the idea of it is
0:47:55
stored in the database apparently
0:48:01
um but i could be wrong because i'm just
0:48:08
it sounds it sounds like um that
0:48:11
probably is what hap what happens here
0:48:17
there's a second lambda function which
0:48:23
as soon as someone in the chat room
0:48:26
sends a message that is actually stored
0:48:36
someone actually disconnects
0:48:43
that's not actually stored in
0:48:49
it looks like too that send message
0:48:52
lambda also is responsible for
0:48:58
yeah yeah to all the clients yeah yeah
0:49:06
honestly i was thinking that okay i
0:49:09
would just probably need to import some
0:49:12
library you can do i
0:49:15
connection how it and it would all just
0:49:21
yeah you were dreaming man
0:49:23
yeah it's a lot more work than that
0:49:28
now that's that's that's how i always
0:49:30
start a project i'm like
0:49:32
yeah this this shouldn't take too long
0:49:38
famous famous last words right
0:49:41
yeah they shouldn't take too long and
0:49:44
the more you learn about it
0:49:49
why did i say that
0:49:52
but yeah and but i still keep saying it
0:49:56
like the most naive person it's so funny
0:50:00
i'm i'm getting a little bit better at
0:50:01
gauging how long something will take it
0:50:05
i see yeah but usually it's i'm just
0:50:08
like so far off because there's always
0:50:10
things you run into in doing a project
0:50:12
where it's something new and then you
0:50:14
have to spend time
0:50:18
yeah and i completely agree
0:50:21
with you and i think that all comes with
0:50:25
with with with uh experience as in the
0:50:29
more you do stuff the more you start
0:50:35
how much actually the ability of quick
0:50:44
logic have you actually developed and
0:50:46
then based on that experience
0:50:50
you start as in kind of
0:50:52
engorging as in approximately this
0:50:54
should take me probably a week or two
0:50:57
but yeah it all comes with experience i
0:51:08
okay what i'm going to do is i'm going
0:51:13
we should probably
0:51:14
look for a video because i still
0:51:18
want to have my an understanding of it
0:51:27
diving into the step-by-step process
0:51:35
um if i ever were to guess i would say
0:51:38
this would probably take
0:51:48
as in from scratch in this video i'm
0:51:51
going to show you how to set up
0:51:52
websockets using ap
0:51:56
yeah i like i have no idea honestly oh
0:52:01
yeah i can't of course
0:52:06
it could be it could be
0:52:08
something challenging it could be not
0:52:13
i sent a video that maybe is helpful
0:52:19
i was gonna say do you mind
0:52:22
playing it on your end because um
0:52:27
i do it because i've got the headphones
0:52:29
on you won't be able to hear me as in on
0:52:31
this screen with all the
0:52:36
let me see if i can get this
0:52:44
i like the guy who makes these videos i
0:52:46
forget his name but i remember his
0:52:48
handle as be a better dev
0:52:52
in this video i'm going to show you i
0:52:54
think he works at aws
0:53:01
how do i share the audio
0:53:07
audio though don't worry about oh you
0:53:09
okay i can hello everyone in this video
0:53:12
i'm going to show you how to set up
0:53:14
websockets using api gateway we're also
0:53:16
going to use a lambda function to
0:53:18
respond to incoming messages from our
0:53:20
clients this honestly took me hours to
0:53:29
gateway section of the aws console to
0:53:31
create our api gateway websocket-based
0:53:34
endpoint so i'm just going to api
0:53:36
gateway here and clicking on the api
0:53:39
and then this is the default screen that
0:53:41
you get greeted with we're going to
0:53:42
scroll down here and go to the websocket
0:53:45
api section so we're going to click on
0:53:48
and first thing you need to do is just
0:53:50
give your api a name you can call this
0:53:52
anything that you want that's relevant
0:53:53
to your application i'm just going to
0:53:57
and the next section here is talking
0:53:58
about route selection expression and the
0:54:01
way this works is that when someone
0:54:03
sends a message to your api gateway
0:54:06
websocket endpoint
0:54:08
you need to kind of give it a
0:54:10
in a sense api name or a path sometimes
0:54:13
also called an action and that's going
0:54:15
to map directly to what lambda function
0:54:17
we invoke on the back end so to give you
0:54:20
a better idea of this we're going to
0:54:22
send a request that looks a little bit
0:54:23
something like i have in front of you
0:54:25
here so we're going to send a request
0:54:27
when we communicate from our client to
0:54:29
our backend that looks like this so it's
0:54:30
going to have action as a key and the
0:54:33
name of our route which is going to be
0:54:35
send message that's what i'm going to
0:54:36
put in the box in a moment here and then
0:54:39
we're also going to put message and then
0:54:40
we put in whatever text you want for our
0:54:42
message you can of course also include
0:54:44
some other data here but i'm just
0:54:46
putting a basic string in so that's how
0:54:48
this is going to work we could just put
0:54:49
in the defaults here request.body.com
0:54:52
and that will ensure that whatever
0:54:54
action is passed in we will forward that
0:54:56
message to the corresponding route if
0:54:58
this doesn't make sense it'll make more
0:55:00
sense in a couple minutes here when we
0:55:01
create our roads in our landing so let's
0:55:03
put in request.body.action
0:55:08
and then we are going to go ahead
0:55:12
so there's a couple things to know in
0:55:14
terms of how web sockets work
0:55:18
so there's a couple kind of hooks that
0:55:20
you can feed into uh in terms of when
0:55:24
clients connect to your website
0:55:26
when they disconnect and when they send
0:55:32
message then you also have the ability
0:55:34
to define custom routes and these can
0:55:42
for this demo i'm just going to use one
0:55:44
called send message
0:55:47
um so first of all i want to add the
0:55:50
connect right i want to have a specific
0:55:51
lambda function that gets invoked
0:55:53
whenever a client connects to my
0:55:56
so i already created a lambda function
0:55:58
that has some boilerplate code but
0:56:00
that's already created and all you
0:56:02
really need to do just to get this
0:56:05
without the lambda function is just
0:56:07
click on the add connect route and it
0:56:09
will show you this preview here and then
0:56:11
we also want to do the same thing for
0:56:12
disconnect so i also have a lambda
0:56:14
function for disconnect and i also have
0:56:16
another one i don't have a default but i
0:56:18
have one called send message so i want
0:56:21
to click on add custom route here at the
0:56:24
and so i'm going to call this send
0:56:25
message and remember what our json
0:56:28
looked like as a reminder it looked like
0:56:31
this so the route key is whatever is
0:56:33
inside the action so action send message
0:56:36
and then we're using the route key send
0:56:38
message okay and you could also make
0:56:40
like multiple of these if you want but
0:56:42
we're just going to do one in this
0:56:43
example so now we're going to click on
0:56:45
next in the bottom right now it's asking
0:56:47
for the integrations for all of our
0:56:50
endpoints or all of our routes here
0:56:52
so the first one for connect i have a
0:56:53
lambda function which i'm going to use
0:56:55
here you can see you have some other
0:56:56
options as well if you want to use http
0:56:58
endpoint or just a mock for a temporary
0:57:01
solution i'm going to select lambda here
0:57:04
and then make sure to select the
0:57:05
corresponding region if you don't know
0:57:06
your region it's in the top right here
0:57:08
mine is north virginia usc 1 and i'm
0:57:12
grab my lambda function here that is
0:57:14
called connect so now whenever someone
0:57:16
tries to connect to our websocket
0:57:18
endpoint we are going to invoke our
0:57:19
lambda function and we'll see a little
0:57:21
bit later what gets passed into the
0:57:23
lambda function it turns out it's the
0:57:24
connection id and some other information
0:57:27
uh so let's do the same thing for our
0:57:29
disconnect uh so we're gonna go to
0:57:31
lambda and then we're gonna put in our
0:57:33
disconnect lambda function if you don't
0:57:35
care about disconnect or any of this
0:57:37
stuff you can skip this step but and
0:57:38
then for uh integration for our custom
0:57:40
route which is send message i'm going to
0:57:42
go to lambda here and again we're just
0:57:45
going to select our other lambda
0:57:46
function which is called send message so
0:57:49
go ahead and click on next now and now
0:57:51
it's going to ask you for which stage
0:57:52
you want to deploy this to it's going to
0:57:54
automatically kind of suggest a stage
0:57:56
here if you don't already have one you
0:57:57
may need to click add stage and then
0:57:59
i'll just have it in there but you know
0:58:01
you have a production stage a testing
0:58:02
stage maybe a gamma stage or something
0:58:04
we're just going to leave this as
0:58:06
production for now so go ahead and click
0:58:08
on next now in the bottom right now this
0:58:10
is just going to give us a little bit of
0:58:12
a population page of all the settings
0:58:16
so this looks pretty
0:58:26
that you see when you successfully
0:58:28
create your api gateway websocket-based
0:58:30
endpoints i'm just going to close this i
0:58:32
want to go back to api gateway just to
0:58:34
show you how to get back here so you can
0:58:36
see here now we're in api gateway
0:58:38
homepage we see our websocket endpoint
0:58:40
here and it's of course websockets so
0:58:42
now if you click on this you get back to
0:58:43
where we just work okay so a couple
0:58:46
things that you want to kind of know
0:58:47
about here so we have our different
0:58:50
routes that we just created right so we
0:58:51
have our connect route and you can see
0:58:53
here when a request is coming from the
0:58:55
client it's getting routed um to the
0:58:57
connect point here the connect path and
0:58:59
then that's going to our lambda proxy
0:59:02
there the same thing is going to be ha
0:59:03
happening for our disconnect it's pretty
0:59:05
much the exact same pattern now it's
0:59:07
going to the disconnect path disconnect
0:59:09
route rather and it's going again to our
0:59:12
and then uh for send message the same
0:59:14
thing is happening so all three are
0:59:15
doing the same thing keep in mind here
0:59:17
if you change any of the settings here
0:59:19
you do need to go ahead and redeploy the
0:59:22
so you just select the one that you want
0:59:24
to change or that you want to redeploy
0:59:26
go to actions and then go to deploy api
0:59:29
by default this is all done for you but
0:59:31
just keep that in mind if you make any
0:59:32
changes here all right so the next step
0:59:34
is to get the endpoint the websocket
0:59:36
endpoint that api gateway created for us
0:59:39
and just try to connect to that endpoint
0:59:42
um so if we go to i believe it's stages
0:59:44
yeah it's right here and then we have
0:59:46
our production stage
0:59:48
and then you can see here our websocket
0:59:50
url and we also have a connection url
0:59:52
and so the way this works is that the
0:59:54
websocket url this one that starts with
0:59:56
wss is what the clients on the front end
1:00:00
connect to so we're going to see that in
1:00:01
a moment here when we use a tool to try
1:00:03
and connect to our endpoint and the
1:00:05
connection url is the the endpoint
1:00:08
that's used to post messages back um to
1:00:11
clients from the backend so the back end
1:00:14
can push messages to the front end and
1:00:16
we have to remember that it's only going
1:00:18
to be capable of pushing to clients that
1:00:20
are connected so what i want to do is
1:00:22
just go ahead and grab this wss
1:00:25
string here and we're just going to go
1:00:27
and test this out really quick i want to
1:00:29
go to a neat little tool here
1:00:31
to show you how to connect to this thing
1:00:33
so i just go and change that all right
1:00:35
so this is the tool that we want to use
1:00:39
pi socket.com it allows you to basically
1:00:42
test your websockets there's a whole
1:00:44
bunch of tools that exist out there you
1:00:46
can just search websocket tester online
1:00:48
and i'm sure you'll get something that's
1:00:52
right so what we can do here is we can
1:00:54
just paste in our websocket endpoint and
1:00:56
this would be the same way that like
1:00:58
someone connects from you know a
1:01:00
front-end application using some react
1:01:02
library or something like that or you
1:01:05
know some command line library it's the
1:01:06
same process so you just put in the url
1:01:09
click on connect here and you can see
1:01:11
connection log will appear here
1:01:12
connecting to blah blah which is our um
1:01:15
websocket endpoint and we can also see
1:01:17
that connection has been established
1:01:19
which is good for us so let's go back to
1:01:21
api gateway now and now what i want to
1:01:24
do is just bring us over to the section
1:01:26
that has our lambda functions to look
1:01:29
inside and see what they're doing
1:01:31
so uh let's go to the top here and type
1:01:34
in lambda actually let me just make sure
1:01:36
i have this copied um to my clipboard
1:01:39
actually you know what i need this url i
1:01:41
need the https url um because we want to
1:01:43
post back from our lambda function we
1:01:45
need to grab this url so that we can put
1:01:49
config when we try to reply to websocket
1:01:52
messages or broadcast messages out
1:01:54
rather so let's give a lambda now and
1:01:56
i'll show you some of the functions that
1:01:58
i've pre-created here so here we are in
1:02:00
lambda um so i have four different
1:02:02
functions here let me just quickly
1:02:03
describe to you what these do
1:02:05
so first of all is connect connect is
1:02:07
pretty straightforward it's the lambda
1:02:08
that gets invoked whenever someone tries
1:02:10
to connect to our websocket endpoint
1:02:13
disconnect is the same thing it pretty
1:02:14
much does nothing it just logs out the
1:02:17
send message is when someone tries to
1:02:19
send a message from the clients to the
1:02:22
back end okay so someone is pushing a
1:02:24
message from the client to the back end
1:02:26
then i also have another function here
1:02:28
called broadcast and this is more of a
1:02:32
doesn't have any knowledge of any
1:02:34
incoming messages it's just gonna be
1:02:36
capable of taking an input from the
1:02:37
lambda function event and pushing a
1:02:40
message to a corresponding client so
1:02:42
we're gonna see all of these in action
1:02:43
in a second here so what i want to do
1:02:45
here is go to connect and just show you
1:02:48
the code that's here it's basically very
1:02:50
very simple now a pro tip that you need
1:02:52
to remember is in all of these functions
1:02:55
you need to return a status code of 200
1:02:58
or else you're going to run into errors
1:02:59
and the worst part is that the errors
1:03:01
that get thrown from the websocket
1:03:03
client perspective say like really
1:03:05
stupid things like internal server error
1:03:07
and some other like abstract and useless
1:03:09
messages that don't really mean anything
1:03:11
so make sure the first thing you do when
1:03:13
you create your lambda functions is come
1:03:14
here and just return status code 200
1:03:16
we're also going to have all these
1:03:18
errors and really want to represent
1:03:20
all right so you can see here that i'm
1:03:22
i'm logging out two different things the
1:03:23
event and the context so we already
1:03:26
connected to our endpoint so this lambda
1:03:27
function already got invoked and so we
1:03:30
can go take a look at our logs really
1:03:31
quick uh so i'm just going to go to view
1:03:33
cloudwatch logs over here and this is
1:03:36
going to launch a new page
1:03:38
and where is it so yeah i was messing
1:03:40
with this a little bit earlier so you
1:03:42
can see um there's a whole bunch of logs
1:03:44
here just want to scroll down um and
1:03:46
there we go so this is the request that
1:03:49
we just made so 2022 that's just a
1:03:51
couple minutes ago so that's right uh so
1:03:54
this is the event that gets passed in
1:03:56
from the client on connection to our api
1:03:59
gateway endpoint remember in our lambda
1:04:02
if we go back to the code really quick
1:04:04
first thing we're doing is printing the
1:04:05
event then star star star and then
1:04:08
context go back here
1:04:10
we're printing the event
1:04:11
sorry printing star star and then
1:04:13
context which happens to be an object
1:04:15
that we can't read
1:04:16
all right so if we we look at this thing
1:04:18
like this is like pretty hard to read
1:04:20
but if you like look pretty closely i'm
1:04:22
gonna just control that and type in uh
1:04:24
connection id connection id it's this
1:04:27
thing down here right fub and blah blah
1:04:29
blah so when we try to reply to our
1:04:32
client we need to specify that this is
1:04:35
the connection id that we want to use
1:04:37
when we reply now since this is just
1:04:39
during like a connection step this
1:04:41
doesn't really matter however if you
1:04:43
were building an application where you
1:04:45
need to kind of keep track of all the
1:04:47
connection ids that exist at a current
1:04:48
point in time like a gaming application
1:04:50
or a chat room application or something
1:04:52
you would probably want to save these
1:04:54
into the database like a dynamo table on
1:04:56
connect and then remove them on
1:04:59
disconnect so that you can always keep a
1:05:00
snapshot of the current live connections
1:05:03
that you have an endpoint to that's how
1:05:05
you would kind of maintain state on the
1:05:07
clients that are connected to your
1:05:09
endpoint but anyways that's a whole
1:05:10
different thing just remember that
1:05:12
connection id is in here alongside all
1:05:14
this extra stuff that for the most part
1:05:16
you don't really need to worry about so
1:05:18
i want to go back to my uh lambda
1:05:19
functions here and then just walk you
1:05:21
through some of the other stuff
1:05:23
so going back to functions disconnect
1:05:25
does the exact same thing it's not even
1:05:26
worth looking at to be perfectly honest
1:05:28
with you and then um send message so
1:05:31
this is the lambda that gets invoked
1:05:33
when the client sends a message to the
1:05:37
so send message what does this thing do
1:05:39
so you can see here we're importing some
1:05:42
libraries we're also using bogo3 which
1:05:44
is the python sdk to call
1:05:47
aws endpoints first thing we're doing is
1:05:49
creating a client so boto3.client we're
1:05:51
using the api gateway management api
1:05:54
this is the client we're going to use to
1:05:55
respond to messages and then for
1:05:57
endpoint url this was that url that i
1:05:59
just grabbed a few minutes ago i hope i
1:06:01
still have it on my clipboard yes i do
1:06:03
um so all you need to do is just pull
1:06:05
post that in and then um it's just slash
1:06:08
um whatever your stage is so mine was
1:06:09
just production i don't think you need
1:06:11
to slash at the end i'm pretty sure
1:06:12
that's going to be fine but
1:06:14
if this doesn't work that may be problem
1:06:16
anyways scrolling down a little bit so
1:06:18
we're just printing the event first and
1:06:20
then we are extracting out that
1:06:21
connection id from the input object it
1:06:24
happened to be inside of a nested object
1:06:26
which is request context and we're just
1:06:28
getting the connection id
1:06:30
i'm doing something interesting
1:06:32
typically you would probably like save
1:06:33
to a database or do something you know
1:06:36
it depends on your application
1:06:38
and then um form the response and post
1:06:40
back to the connection id so now we're
1:06:42
replying back to the client by posting a
1:06:44
message back to the connection id that
1:06:47
was provided in the input and we are
1:06:49
just uh actually this should just be
1:06:51
pointing to response message here so
1:06:56
and then we're returning status code
1:06:58
200. now i'm just going to deploy this
1:07:00
really quick and just before i test this
1:07:02
out on the front end i just want to show
1:07:04
you something really quick this took a
1:07:06
little while to figure out
1:07:08
but basically any lambda function that
1:07:10
wants to use this api gateway management
1:07:12
api to post back to an endpoint needs to
1:07:15
have some specific api gateway
1:07:17
permissions so uh if we go to
1:07:19
configuration here i'll show you really
1:07:21
quick the role that i had to create
1:07:23
um where is it permissions yeah so
1:07:26
so send message role if you click on
1:07:28
this it's going to open a new window
1:07:30
and you can see here the policy that i
1:07:32
have attached to it is one called amazon
1:07:34
api gateway invoke full access
1:07:37
this is required in order to post back
1:07:40
to that url endpoint you go to attach
1:07:43
policies i'll just show you how to do
1:07:44
that really quick just go to attach
1:07:45
policies and just search for api gateway
1:07:49
and i think because i already have this
1:07:53
already attached it's not gonna let to
1:07:55
do it again but you would just click it
1:07:56
and then click next next next and you're
1:07:58
pretty much good to go one more pro tip
1:08:00
after you add a new policy to your
1:08:02
function's role you need to redeploy if
1:08:04
you don't your lambda will not have the
1:08:06
new permissions that you just assigned
1:08:08
you can do this by making a small code
1:08:10
change and clicking the deploy button on
1:08:12
your lambda function all right so that's
1:08:13
the role that i have on this so make
1:08:15
sure you have this both on your send
1:08:17
message um lambda and your broadcast
1:08:20
lambda which is kind of a similar
1:08:22
functionality i'm going to close this
1:08:24
really quick um so now our send message
1:08:27
function is pretty much good to go so
1:08:29
i'm going to try and go and send a
1:08:31
message from our client here and see if
1:08:34
we get that responding dot dot back
1:08:36
because that's what our lambda function
1:08:38
returns with so let's say um remember we
1:08:41
need to put this in a very specific
1:08:43
format so we need to put action remember
1:08:46
this was the you know
1:08:47
request.body.action thing when we
1:08:49
initially configured our api gateway
1:08:52
endpoint remember now that this needs to
1:08:54
be the correct route name of whatever
1:08:56
you created mine was called send message
1:08:58
so i'm going to put in send messaging
1:09:00
quotes here and then
1:09:02
the content is in something called
1:09:04
message so you just put message
1:09:06
and then just say hello
1:09:11
and close bracket so we should see uh
1:09:14
responding dot dot dot if everything
1:09:17
there you go so we're responding based
1:09:19
on that lambda function indication all
1:09:21
right cool so what if now we have some
1:09:24
process that wants to just kind of push
1:09:27
messages to all the available clients
1:09:29
that are currently connected how would
1:09:31
we go about doing that well first of all
1:09:33
we need to know which clients are
1:09:34
currently connected so like i don't know
1:09:36
the connection id of this guy so i'm
1:09:38
going to have to go and check the logs
1:09:39
really quick so let me just go and do
1:09:41
that i'll show you how this works so we
1:09:43
can go um actually is this the one no
1:09:46
this isn't the one actually this is the
1:09:47
one this is the connect so we can just
1:09:49
grab our um connection id out of here
1:09:52
just to show you how i got here reminder
1:09:54
we're just in cloudwatch we're under log
1:09:56
groups or under our connect function and
1:09:58
i just went to the first live stream and
1:10:01
expanded the message and picked up the
1:10:02
connection id here and what we need to
1:10:04
do now is go to our broadcast message
1:10:07
and take a look at what that does i'm
1:10:09
actually going to open that in a new tab
1:10:11
because i realize i'm going to need
1:10:12
something from our other function in a
1:10:15
so let's go to broadcast
1:10:16
and you can see in the implementation
1:10:18
here sorry about that um this this does
1:10:21
something very very similar so again
1:10:23
we're creating that client api gateway
1:10:25
management api we got to put this url in
1:10:27
which i unfortunately just cleared for
1:10:30
and then we have our lambda handler this
1:10:32
one works a little bit differently in
1:10:34
the sense that uh you're going to be
1:10:35
able to pass an event in that contains
1:10:38
the connection id and the message that
1:10:40
you want to broadcast to the clients so
1:10:42
we're going to extract that out of the
1:10:44
event and extract that out of the
1:10:45
message and then we're just going to
1:10:47
post that message back so connection id
1:10:49
is equal to connection id and the the
1:10:51
data is equal to whatever's inside of
1:10:53
the message which is right here right so
1:10:55
then if we look at our test event here
1:10:58
we can say configure test event and now
1:11:00
we need to put in our connection id
1:11:03
put in that connection id and then we
1:11:05
can put whatever message that we want
1:11:06
out there so we're going to send this
1:11:08
message to our front end from the
1:11:10
backend perspective that's effectively
1:11:11
what this is going to do so i'm going to
1:11:13
click save there i need to just go and
1:11:15
grab this url because i cleared it from
1:11:16
my clipboard so let me just go back to
1:11:18
my uh i think my send message function
1:11:22
pretty sure okay there we go it's right
1:11:23
here so just grab this
1:11:26
going back to the broadcast function
1:11:35
oh i did production twice oops
1:11:38
all right that looks good uh so now
1:11:40
let's just make sure that we deploy that
1:11:42
um everything looks good here in terms
1:11:44
of the code let's just go to our
1:11:47
function over here so we see here
1:11:48
nothing really is showing up i'll clear
1:11:50
this just to prove that everything is
1:11:52
empty i'm going to go back to my
1:11:54
broadcast function i'm going to click on
1:11:57
and you can see like no response here
1:11:59
which is good we did have a response but
1:12:01
i'm not going to look at that we're
1:12:02
going to go back and you can see we
1:12:04
received a message hello anyone out
1:12:06
there or anyone out there so i hope this
1:12:08
was useful in getting this set up i'll
1:12:10
make all this code available and if
1:12:11
you're interested in learning more about
1:12:12
api gateway and aws check out this video
1:12:15
on the right thanks so much and i'll see
1:12:26
you're muted you're muted
1:12:30
oh sorry my bad there was
1:12:34
yeah this was a law in one go
1:12:43
but yeah i think oh um
1:12:45
good thank you that um thing with
1:12:49
me as in the link really helps i'll just
1:12:54
save in my word document and so that i
1:12:57
can access it afterwards as well
1:13:00
looks like there's a part two as well
1:13:06
yeah um right and i'll have a look at
1:13:12
yeah the the one thing i was wondering
1:13:17
like when is the broadcast
1:13:20
triggered although i could just look at
1:13:22
this other diagram that was in the aws
1:13:27
um when is that broadcast
1:13:30
diagram landa triggered because i guess
1:13:33
would you trigger it from the send
1:13:35
message lambda and pass in
1:13:39
like how do you yeah i guess i'm just
1:13:42
i guess when it saves to the database
1:13:47
i don't know i got to think about that
1:13:49
i wouldn't be able to honestly you mad
1:13:53
this concept is actually really brand
1:13:55
brand new so i'm still a baby in this
1:14:01
yeah well yeah i can say that i guess
1:14:08
helped me a little bit with the concept
1:14:11
but working with aws and websockets no
1:14:17
we will get there yeah
1:14:24
i think it's all about understanding it
1:14:29
get it working i'm going to make sure i
1:14:32
write a blog on this as well so that
1:14:35
will actually keep
1:14:38
going anything back to the reference and
1:14:40
then coming back so back and forth
1:14:45
is done successfully but
1:14:47
that has i think few
1:14:50
few weeks to go still
1:14:53
yeah that sounds like a great idea
1:14:56
yeah yeah i'll definitely write
1:15:00
a blog which hopefully
1:15:03
will be helpful to other people as well
1:15:10
yeah man so oh wow there's 10 45 already
1:15:13
the time just flew past yeah that was a
1:15:18
yeah that's right um got a lot
1:15:21
to learn from this session and
1:15:27
from you sharing your understanding and
1:15:31
websocket that was really helpful so
1:15:33
thank you for that and um
1:15:36
yeah i'll see you on
1:15:39
thursday now uh-hum
1:15:41
same time same place and
1:15:45
a different task same time yeah
1:15:48
no different tasks
1:15:50
all right different parts thanks zayn
1:15:52
perfect man um good to have you again
1:15:55
tori and you have a great
1:16:00
yeah yeah yeah it's nighttime here yeah
1:16:05
thanks for watching
1:16:07
cheers guys we'll see you guys back