Message Queue From Scratch In Golang

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
very good evening on this what are we Wednesday on this beautiful Wednesday and Christmas coming it's amazing M my favorite time of the year is Christmas because I don't know it cures my anxiety yeah it is what it is um what am I doing here let's post some stuff I'm also live on Twitch by the way look at that hi twitchers what's up man what's up this one guy it's probably my he look at that isn't that pathetic um I also need to update my Discord real quick here where is Discord here is it tell me everything guys what what are you been doing these past days man what what what are you building what's going on how the gym tell me the girls tell me everything or the boys hey [ __ ] somebody's at the [ __ ] tour look at this guys oh Christmas I was talking about Christmas and look what's going on here my dog is barking like a like a Savage look at this what I got God [ __ ] damn it live on stream look at this what would that be I have no clue it's a birthday it's it's a birthday present um yeah it's a birthday present so I cannot open it you know what I mean because I'm it's not my birthday 28th November write that [Music] down there should be another package uh arriving this evening right I have no clue why it's so late but if you hear the Bell or my darkg barking my dog barking let me know in the chat because noise cancellation everything tech music and all that stuff what's going onama ibraim of course why Osama is always herea n Alum aloh look at this man I can greet everyone in his own language this is crazy uh Auntie what is up David what's up man welcome boss Dean cash what's up little de what's popping hello from Turkey nessle maraba n wait something is is is running in the [ __ ] background let's twitch what is up undel from twitch actually to be honest uh I need to [ __ ] have this twitch chat somewhere wait how can I do this what's going on let's pause this [ __ ] here real quick before we going to build the message que uh continue the message K in go and it's our consumers so we need to do web sockets because yeah yes I watch League of Legends streams guys I know I know how can I detach this thing uh where is this here chat lost cou that's basically means detach the chat look at that beautiful I'm GNA put it in here yeah yeah yeah yeah brother the guest what is up back on Twitch yeah so I'm basically doing multi streaming I need to record so my PC can explode but should be fine um are we set actually this guy delete this yes yes yes open up the G stream so we can start Merry Christmas Mohammad what up hello Anthony how are you doing I'm doing actually pretty fine not going to lie I'm going to lie where are you originally from I'm from Belgium yeah baming flaming vam beautiful man in German the in German the word L couple also exist yeah I think it's the same your voice is a little low how is this even possible man I already bumped that up so hard guys please is my voice low is the sound bad let me know cuz I'm basically figuring out settings and limits and gains and and and noise compressors and compressors and another it's crazy I I a streamer guys let me know let me know if somebody has experience with all these [ __ ] settings jump into my Discord community and help me you know what I mean I can't even pay you [ __ ] money if you can fix all that stuff I don't give a sh voice is fine thank you Joe by the way uh I'm a Joe he's also working at leue with me from my community and I love this guy he's the best um PR Okay cool so what we going to do we're going to keep continuing this um message Q here right uh let me think what did we do so I think we have something uh in CMD which is the test publish right so we could do something like this let's clean go run CN that's publish name of go right so yeah of course we need to run this thing also that's uh yeah yeah yeah make maybe like that yeah pretty fine pretty fine and then we can actually run this command here boom and it's going to publish to our uh message Q fine uh at the topic one apparently right that's good so that's fine but now we need to what's going on I'm guys please it's like the thing is that I'm working 24/7 but people they don't right so they they're going to call me like ha I'm done working ha I'm going to I'm going to I'm going to send them a message or call him no you don't you leave me alone okay so that's fine um we're going to use the consumers the first thing we maybe going to do is in this make file it's going to do something like test P we going to say here at go go run uh CN D May no uh test publish I guess guess may not go right why do we do this because then we can actually do make p here uh make test P yeah that's fine so we don't need to type that in right you know what I mean actually make a space here close this thing um consumer yeah we have this function full just to so we know we we stopped here right so that's what we're going to do thank you so much y with love for the donation man for the Super Chat thank you so much this is a little late but congrats on the marathon oh boy my my my today it's actually my rest day from the gym and I thought I am going to go for a 6 kilm run oh boy that was crazy I'm going to lie all my condition is it's completely gone at least we can do squats again right at least we can do squats and that lifs heavy um now that we don't need to train for the [ __ ] Marathon was it was wild anyway but I got the metal that's that's that's what I wanted right yeah so web yeah yeah yeah yeah consumers guys let me think it's going to be hard we have this interface here okay cool let's open up main maybe server maybe yes uh um what do you think about a task file instead of a make file ah it's they there are probably much better things than a make file but I don't know I'm old I'm so sorry like attempt to stick to things that work that's something that people forget people always going to improve they want to use more exciting stuff you know what I mean and I'm just sticking with boring things I don't know probably because I'm lazy okay so if we want to have consumers we need to have peers and I think we're going to handle we could do we need to handle the Pierce in um in the server right so let's do something like that pierce that's going to be a good question probably a map I have no [ __ ] clue it's going to be I think it's a NETCOM we don't know we need to investigate that with consumer um type ways consumer going to be a stricture that should be like I said guys I have no clue what I'm doing this is all on the top of my head like I'm Bob Ross you know what I mean WS consumer that should be a start function just like that with an addor right uh how can you do that so a consumer is going to dial yeah so that that's actually not this is this is bad this consumer start in PH completely is is it's man I'm choking he right now uh let me think somebody's going to dial so we need a [ __ ] there should be should be start to be honest it is what it is do we need to something like that um how do we do that what's going on producers the man himself has no clue what he's doing handle fun is it something like that/ WS something like this and then uh handle WS right Funk handle [ __ ] but that's not echo or something else that's basically God damn it listen and surf I have no clue guys uh we need to do something like um are we going to use the same port as our HTP transport that's the question right because we have a producer here right which is the HTTP producer and the HTTP producer is listening to Port three th000 because it's a whole gr of ports that's going to be 4,000 I don't care right and then we going to use the Ws itself and I'm we going to say funk this WS pointer to this WS web consumer surf uh HTTP W HTTP do respond writer pointer to an HTTP request why is this screen still open can we do something like this as right so what what we need to do here is we can actually return that um what we need to do is upgrade so we're going to have one consumer which is going to upgrade the webop get connection and each time somebody connects it's going to do some magic voodoo witchcraft what do you think about that 4,000 is the Holy Grail actually the Holy Grail is this port Guys 1 3337 3337 can I type this one that's the Holy Grail of ports but that's a secret um how do we do that I think it's web socket I have no [ __ ] clue we need to upgrade that uh we so get so what you could do so what you can do if if you if you don't know how to do things out of the top of your head you can go to stack Overflow but sometimes you can try stuff until it works for example upgrade you see you type up and then you see some things I think we need to make an upgrader is that true God [ __ ] damn it that's not what we need there also deprecated you know what I mean it's going to be something like this far upgraded it's going to be an web soet do upgrade upgrader which is a stct is it a default upgrader I I I think we put we we put all into this thing and call it a day probably not all all all things and the header we don't need a header so it's going to be w r and n and that's going to return us a com yes and that's a NETCOM or a webs.com I should be it's a Netcong because it's important because what we're going to do here as server right we're going to have something like uh peers or consumers actually why do we have this it's going to be a map netc and what you could do is a Boolean or actually to be honest an empty strick but let's let's do a boo to be to be to be safe not why because netcon is an interface and if we use webset com pointers the problem is that we cannot have some else transport there for example I want to have a custom TCP transport for example with a with a with a rather simple calization protocol or um whatever protocol a UDP UD me Anthony GG who knows right so an atcon is an interface so that's fine I hope um so yeah let's start painting here right right so there's going to be a com and an arrow right and if there's an arrow here uh we're going to say um I have no clue we going to say this right just the erors and then the or something wait we can print this that's fine so now what we going to do what up I what up what's up man what's up boss welcome to the sh movement uh wait so we're going to configure this we have producers here probably going to have consumers man my typing is not on point today I'm not going to lie don't know why Jer too much off today I think could be a reason it's a little bit it's a little bit wanky Anthony it's a programming stream CH we don't have an Constructor for our boy here uh um constrictors always under destrict Funk new WS consumer this one pointed to actually maybe app pointed to this thing also an eror because Bing and then we're going to return n the Ws consumer nil because I don't know and then well this thing is actually so so dumb that we don't need to do anything we can just do this right but that's now that probably going to change uh a couple minutes later into the into the stain um yeah we could give a port in here did we do that for a HP yeah we did well let's do the same thing listen add it's going to be a string right and I'm going to say new consumer listen add uh string here right listen listen let's be let's behave a little bit right listen there something like that yeah yeah yeah yeah we have a config um should we actually yeah we should behave like uh double actually this should be HTP Liston added it's going to be WS Liston added right if somebody is behind me with a knife tell me because I have no [ __ ] clue you can rob my whole house right now you know what I mean you can even steal my duck and it's going to be all fine because I have no clue what's going on um NE consumer CFG doou s listen ad or something like that it's not going to work because I have no [ __ ] clue what's going on tell me ah it's complaining because we have an error so we're going to do we can fix it but we are lazy right so we're going to do this we're going to delete that do this and then not return the no here you know what I mean all right okay cool so now we have these consumers now we need to do server start so we're going to range over these consumers right and we're going to call start on these boys but we need to do the same thing we're going to do a go fun because they're going to probably keep hanging right but how do we communicate that we um need to stop them good question Anthony you see it's again the voice in my head asking me questions yeah that's it that that's the play that's the play wait are we running here yeah we do let's run here real quick make presenter we can't uh um oh that's because we are actually have this test B here I don't want that if I do if I press make it needs to be this run thingy right so I'm going to put that down here boom make clear make uh bind 80 permission Deni made a big mistake I'm going to lie he was that let's see my friend that's so this is so unreadable yeah that's why you need to call me eh isn't it permission theight what's going on am I oh yeah I see no I see not yes I see because here's the config and we need to do something listen uh 4,000 for these boys here save make again cool so uh HP transport start maybe we should log it out what do you think Chad yeah let's do that something like he right as to be honest ASL info small n um web socket consumer started and then we could say on what port actually listen add something like that or Port who cares right uh and that's going to be WS listen add or something like that right make again boom all right cool that's nice so now we basically have uh that setup so now we're going to connect how we going to do that so normally so the cool stuff is about this this message queue with this transport actually the cool stuff is on webset transport is that basically don't need to do a lot of stuff for that if you want to connect with this from other languages rust let me repeat that if you want to connect with other languages for example JavaScript python uh and something else right you just call dial this and then we going to come up with some some subscribing protocol right um but if you really want you can make we could make a library in go which reps web so kets and then you just can call consumer or something you know what I mean uh something like that go start consumer would be better um that's completely true that's true that would be cleaner 100% correct ATI man 100% correct good job boss so this Fu D yeah so what we're going to do I think we're going to make um something simple test consume yeah something like that new file heat may not go uh package main Funk main let's open up consumer hereat let's go copy copy copy copy all the things how many years you code in goang uh that would be 10 years I guess I was pretty early um I I had the look that I actually could convince my bad CTO into using goling because we were using we started with PHP then we swapped to notes because I I found out about note so I said yeah we need to do it in note and then I found out about goaling I said yeah we need to do it in goaling and he was so stupid that he just listened to me and that's how I learned goinging and getting paid and also getting late it was an amazing time to be alive not going to lie what else he the man more uh can I import this yeah we can so we're going to dial this thing so that's going to be a w us [Music] um how does that work Local Host Local Host and then it's going to be the port of ports 4K actually to be honest Anthony can you yeah that's going to be I think it's going to be a connection and an arrow could there's no other way it can be uh if Ash press enter what hell is that is it not what also an HTTP response why why would we need that oh yeah I see it Returns the response probably from uh the consumer thing it's probably going to return the response here if you do a w right you know what I mean that's that's neat not going to lie they know that learning learning each day uh why do you create uh two separate uh commands instead of an argument to a single command yeah I know just because I don't know yeah we could make something like uh with paring arguments and all that stuff but hey it's already done you know what I mean it's already been done don't need to worry about paring arguments um can we do this is going to be a little bit uh tricky guys because this not this is not the easiest thing we going to do um it's very important actually can we have can we can we please type for for for a moment make that's fine uh and then we going to actually [Music] say sounds good to me isn't it it works you know what I mean look at that we're already having bits and bites that's nice um so okay cool that's fine so what we gonna do here no we need to do guys in this stream we need to do three things we need to make sure we have the guy that consumes the consumer that dials is in our peer list we need to make sure that the consumer that dials has some kind of a protocol to let us know what he want to do and then we need to make sure that everything that's not committed for that kind of con uh consumer group is being pushed over the webset connection that's three things and that's uh that's not not the easiest things that's not the easiest things to do so we're going to do that so first problem we have a consumer we have a server how are we going to communicate to the server that there is a new beer knocking on the door here this connection again like in the previous stream we said yeah but we could actually use the server and put that into the consumer and then we can call server ATP with the mutex and it's all good true and actually I'm tempting to do that because it's going to be very easy and it's going to feel off if you do that if you do this server it's going to feel a little bit off because it gives you the power of that gives you like hey programming is so [ __ ] simple which actually is you know what I mean sometimes you do something and then you say hey but it's so simple and because it's so simple you're going to question yourself if this is the the right approach isn't that crazy isn't that insane that coming up with a simple solution is going to question yourself hey this is too simple I need to make it much harder let that sink in it's I'm I'm just like it's sinking in right now it's crazy that's that's that's authentication s what are you doing man God damn it of course authentication is also something you we can integrate but like I said first things first you know what I mean uh so let's say we can also use some kind of a pier Channel and that seems to me is the best of both worlds right because if we have a server here then we can actually do something like server uh Pierce it's actually a private variable anyway you know what I mean you could do add Pier you could call AD peer here actually uh public function add pier and then do this right uh this connection right or add you know what I mean and it's all fine but then your server Piers needs to be protected with a without mutex um and so on but that feels so good you can also use a channel P channel right you could do WS P Channel and you can actually uh what's going on here make a p or a connection in here right something like that but then you need in your server what you need here is again we have this this Loop here right then then you can actually use this thing to communicate like case be or connection actually uh and we say SP which doesn't exist right and then we can add it without a mutex guys decides how we going to do that where's the Vim good question I did did it I did it my way no I did it both ways in the past uh I see I see some people using using a channel and I also see people that don't give a [ __ ] and don't use a channel the question rather is performance mutex is okay but it's a pier it's adding [ __ ] peer what kind of performance do you need for adding a p Zero Performance it doesn't matter you know what I mean as long as this guy don't need to wait 10 minutes it's fine um like I said it if you were a Game Dev if you are a game developer which are basically the chats of developers let us be honest because web development I'm so sorry but it's full of nitpicking dumb asses I'm so sorry but it is what it is right but in game da everybody's just a chat you know what I mean so what we going to do is this let's try let's experiment if it's bad it's bad then we can change it up if you want to use a channel you can use a channel it doesn't really matter right so we're going to make get function here uh get store for topic yeah let's it's un important function so we're going to do it here as pointer server add add P add connection maybe what do you guys P what do you guys love atom that's maybe better right at com c it's going to be a net com right just like that so we're going to say um as I'm going to change it up here com how is the music can you actually hear it I can hear it man this is I don't know what it is the vibe um as just like like that s cons equals bent s cons C it's a [ __ ] map you [ __ ] now it's a Boolean but you can add some more information about that specific P because the problem is you have an interface and the the neton interface can we save this and go going GG oh my God this is I love it so the netcon interface only has read right close local other remote other and then some some set deadline V deadline yada y y y right nothing nothing use well a lot of useful things but nothing really describing your peer maybe you want to add a handshake maybe you want to add I don't know some some name I don't know something right you can't um you could rep you could you could make your own peer interface or you could make your own peer it doesn't need to be an interface you could make a pointer just a structure a structure where you put that connection in with some additional information that's also an option like I said programming there's so many options you know what I mean it's it's like it's like the Kam Sutra there is no such thing that's wrong or bad some things are just more difficult to perform but looks much coolish depends you know what I mean some people like it from behind and some people like it from from a complete other angle to be honest I I say on my Discord like guys you don't you should not read books for programming you should not read books but actually the Kamasutra is a very good book I think every every you can read things in the kamasa that's crazy it's like what the hell is that I never even seen this how do you do that either it's crazy like what the hell is that how are people doing this this this is this is dangerous stuff in that man you need to be a [ __ ] athlete holy crap that's insane no 90% of the chat Kamasutra huh Google oh yeah that's it that's it but we going to actually say something like uh oo why don't you use air I have no clue what air is my friend tell me tell me what it is what kind of package is that we don't use any packages the only thing we're going to use is the gorilla web soet thingy because yeah we're not going to write web sockets from scratch you know what I mean um I have no [ __ ] clue the problem is actually actually guys what we need to do is this um what up so listen let's do nothing here can we do that I'm going to I'm going to I'm going to teach you something I'll teach you I'm going to say something actually uh what we should do with these p and these connections add yeah we can't you're not going to be kidding me it's going to be con actually to be honest can we do that please say we have we we don't this connection is not that yeah it does not implement the Coe interface I completely agree the problem is do we have something then the line come but we need to write are we [ __ ] uh so let's let's read here right neton Returns the underlying connection that is by C note that writing to or reading from this connection directly will corrupt the webc connection that that's that's the problem we need to write and we need to we need to write because if we we need to write so that basically means but this thing has right right right right I want to see this connection sometimes you need to dive in guys like I said does this connection has right this is the underlying one this is actually the goang standard Library NETCOM which has right the problem is documentation tells us that hey if you use the online connection and you use right you're going to pollute the web soet we don't want that uh the question is this this com this com can I right fatal right bth you see it doesn't have right it's time to bring on it's time to bring on the serious stuff it's time to basically actually do programming guys now we're going to actually learn you how to program what's going on can we kill this here air is a mess blow the [ __ ] for hot reloads yeah yeah but we don't need hot reload guys I understand it can be handy sometimes but like guys this we are programmers you know what I mean we are not we are [ __ ] Pro we programmers man come on how how how hard is it to basically just type some stuff sometimes um okay okay let's bring let's bring out the real programming stuff what I'm going to do guys I'm going to make a p. go right we're going to say package p no main no G stream is it main it's main okay actually do not comp interface web this thing let me think let me think we need to call yeah that's what we're GNA do we're gonna say p interface and we're gonna actually say you can watch all these tutorials on on on YouTube and all that stuff you can do that but what I'm going to what I'm doing here right now is basically just is get you higher this gives you a job off if you don't uh if if you if you do not earn 10K a [ __ ] month after watching one year of my videos you doing something wrong I'm so sorry because what I'm teaching you here is basically nobody [ __ ] knows how to do that stuff you know what I mean almost nobody I mean come on you can learn how to do spy full stack apps and and and basically come on your screen with with tailwind and Chad CN but this is this is real Shenanigans going on here guys so the problem is that we need to have a peer interface right and we could say something like a WS peer look at that W us speed which is going to be a structure right so why because we're going to have in this WS speed I'm him look at that is it going to be a pointer yeah probably yeah goodness man this feels so good if it's going to work I have no [ __ ] clue I'm probably shooting myself in the [ __ ] food I'm going to lie in and they're going to say add at all right uh how we going to do that we going to say p it has right it has right but why is it it's probably the [Music] [ __ ] we don't want that gun here to be honest what's going on that's the only thing I actually can speak in French going to lie uh I'm B I'm just beting you all let me see I'm I'm doing programming stuff man like I said uh there's going to [Music] be that yeah yeah yeah wait wait wait wait f net I don't say it's going to be a neton my friend I just updated you interface yo oh we can do this I I don't know I have no clue guys let me choke a little bit that's fine I'm going to embed that thing yeah of course it's right you idiot you're an idiot of course it has right I'm not him what the [ __ ] of course I was I was checking p and and and and right came up and I thought H what the hell but it doesn't have right man what the [ __ ] is that how can I ban this guy I can't where is nightbot what the [ __ ] is going on here how do I [ __ ] ban this boy I can't I can't even man you God [ __ ] damn it are you mad it no no I'm I'm not married God damn it guys why is this so [ __ ] hard man why why do I need to make things so hard so wait why is this G has no right man who's making these libraries who's making this who's making that that's why Jason okay okay they may yeah yeah I see yeah cool nice library but uh yeah so okay okay I okay it's fine it's it's it's good we we can we can handle that so we're going to make a new W so we're going to make this a little bit better we're going to say funk new WS Speed come ony we need to be fast here right we're going to say com we're going to make a com from a websocket doom is fine uh so why do we do this guys because listen if we only use web sockets then it's fine now we don't care now we can just put this websocket pointed into our map and call it a day take the money and set Margaritas on the beach the problem is that we want to support multiple transports I was from the opinion like hey that's good because it's probably everything returns a common in goal line right TCP UDP whatever you call it's a connection grpc has that if you really want to and you can just uh connection is a netcon you can call right and you can call read on that and close whatever problem is that websocket connection is a pointer to uh that thing which WPS the neton but doesn't have uh write and read you could do that if you call underline con but that will pollute the websocket probably the protocol because websocket has a protocol and they basically wrap that with some you know so what we going to do is um hold my [ __ ] Pier hold my Pier that was so good not going to lie uh we're going to say return this we're going to fix it look at that uh like this and then we're going to say that this connection we don't care about that thing uh do we we we do we do we do do we do do we probably not come my that right that's what we do we going to we we are going to say right um but we going to assume I want to use actually want to use uh Json for now so let's say we call everything right Json and we make everything right Json you know what I mean also the TCP P will right Json that's easy to be honest no that's actually we can make it even better how do they call that I'm going to say it's scent man I'm going to change it up I'm going to change the game that's what I'm going to do changing the game um is it right by NTI P right message yes yes yes and it's going to be a web soet type binary binary message B and that's going to return an error please balisimo fantastic VOA that's what we need sent you know what I mean in programming you need to basically let let things obey like you want them to to function right we got this so that basically means this is going to be the scent function which takes in bytes because that could be Json that could be anything we want because it's bites bites orbitary um this this is actually such an important stream I I yeah I mean again it's not because I'm doing this but legit if some if you know this Concepts there is nothing that's going to stop you you know what I mean even your lead developer does not know these things you know what I mean even your lead developer does not know it so how can you fail a how can you fail job interview how can you how can you not make money with it this how tell me we can do something like this actually Pi come whatever it's going to be a new WS be actually guy what the hell be and then we going to say connection beautiful and then we going to say p voila choking and again it's not working I don't know why let me see yeah that's an ncon no no no that's not going to be an Aton it's going to be a p p p and now we're going to change it up again because we changed it to Pier so we're going to say Pierce just to make it a little bit you know what I mean Pierce yes look at that look at this [Music] beautiful that new maybe can we do this what what is aslo going to do with this with this structure who knows probably nothing because it's an interface what is what what what is it going to do it's it's going to print probably dump out a PO uh a pointer at this to be honest that's that that was a wild right not going to lie and now a little happy accident guys um we don't use scent so it doesn't matter uh oh yeah I know I know it's the map I I didn't actually knew but it's the map right so first thing you have a do you have a nil point or something it's basically probably it's a map that's empty right because we're going to have this uh peer map here you know what I mean in server but it's it's we don't it's nowhere to be found you know what I mean it's it's just completely never to be seen so we're going to say make a map of uh pierce with uh a Boolean yeah something my that should basically do the tricka yeah okay cool and now we going to do this right boom press enter okay okay okay okay it's fine it's good hey chill it's not a map something else what the [ __ ] is this I don't even what the hell is going on you should use R because it's a safe language and you cannot have yeah if this is rust we basically were not complete before 2026 um good good have a lot of fun doing Network programming in R wish you the best it's probably okay cool okay come this thing yeah yeah yeah yeah yeah so this is fine yeah okay cool add con server we don't add a server that's it guys it's the server what are you doing you're going to call Adon on N you're not him so we're going to do um uh yeah yeah yeah that's going to be it CER s or something it doesn't really matter right okay cool actually did we yeah yeah yeah all good all good all good all all all according to plan okay cool let let me see twitch how many years you cing go 10 yet I already answer that where's Vim nowhere to be seen uh Blu if you're still here what's your top three books and top top three movies uh top three books I have no [ __ ] clue um but the top three movies would be uh at number three uh I have no clue number two number one is The Wolf of all streets that's my number one movie uh also Catch Me If You Can it's very good let's catch you catch me if you can it's number two and number three is going to be a lot of good movies out there to be honest not going to lie um I don't know the notebook um Titanic Titanic I said the same the same time you typed it in this is amazing um yeah said R is cool fun and all until you have to get [ __ ] done I'm not him that's true uh rust is is not a bad language at all it's just a very the thing is if you're if you're very good if you practice your stuff a lot and you write a lot of rust day in day out you're going to become super fast in Rust right even with networking right that's a thing of course you can you can some someone can easily say yeah but that's a hard language and you cannot do this and y y but by the end of the day it's just because you lag the experience you lag the the muscle memory you know what I mean you you lag the knowledge so you need to look things up a lot you make a lot of mistakes and it's getting your dopam mean your reward system is not getting triggered that much right uh and that makes you quit or makes you go back to where you where you came from you know what I mean [Music] um but I think rust is a good language it's just a little bit too big of a language it it tries to do a little bit too much in my opinion right I love the concept of of memory safety and all that stuff I like that that uh I like the trads traits I like a lot of stuff in rest the pattern matching is amazing error handling is amazing but then you have so many things you can do with it that it's very hard to the the standard library is also so big that there is basically a function for everything for handling arrays handling maps and all that it's like ah it's just too big of a language too big of an idea I think but hey that's my opinion I have some stuff in Rust right um that's not the thing okay where the [ __ ] are we here make what was going on new consumer yeah yeah the Ser Ser Ser Ser Ser it um we're going to do some this is this is going to be such a cool thing trust me okay cool now we have problem because this is server we need to put server inside a thing so we're going to do uh what is going on but hey hey man sometimes I'm completely out of this world and I cannot find anything uh s is this uh return s mil probably and then we're going to say s in here uh that's not going to work Anthony I don't know what you're doing but that that's basically not good I understand uh can we fit can we fit this guy in here then do this join this line do this delete that press enter we can all right all right all right all right all right yes very good very good info addit a new piece and then we're going to get this thing right because and then we have this sprinted out which is the NETCOM and this is probably a right buffer right this is his buffer here big buffer bites pre-allocated probably 1,48 or maybe less 120 I don't know just just trying to pinpoint these things right that's good so we're going to put that thing of course what you need to do is we cannot um we cannot assume like in for now we're going to make it easy and simple but in a real if if we going to make this prediction ready you cannot just add somebody to your peer list if somebody just connects to your endpoint right if first need to do some authentication some handshake some yeah but we're not going to do that we're going to assume that if somebody dials right now and it's going to be that could be for the people that are following me see if you really want to uh learn and you want to you want to how can I [ __ ] say this you want to help you can make you can make a PR where you are trying trying to add a handshake authentication mechanis mechanism mechanism in in in this thing right it's a good lesson for you and it's it's very useful because yeah okay Anthony can I ask you something on Discord like advice yeah sure man uh add me on Discord so I going to friend you and then we can discuss this between you and me you know what I mean um Noob death what up man but Anthony R is really fast yeah but what is fast I mean it doesn't really matter because like I said this this triggers so many people I have shorts about it I have videos about people that that triggers people each time I say hey but performance does not matter and they take it too seriously right they really think that that I mean is that we can write [ __ ] code and and and just have any amount of latency of course not but at at a higher level at a high let's say you build something very clean and goal line right you have a very Min maxed program a min max this is not min max right you first write your idea make it work and then you're going to start Min maxing it you know what I mean it's the same thing if you play World of Warcraft or something else before you're going to minmax your build or P of Exile or Diablo before you're going to minmax your build you're first going to gather the gear right and then when you have all the pieces all the legendary pieces what what you need then you're going to start Min maxing you know what I mean if you have a minmaxed a minmaxed goal line application and a minmaxed rust application maybe in theory at certain scenarios on certain machines rest is going to perform way better but if you take a look at how much speed increase you're going to get for what you need that's is not going to be worth the trouble writing that in Rust right because writing tutorial R is easy and looks very cool but writing production ready concurrent networking R is a p in the [ __ ] [ __ ] but making games I mean making other things in R makes more sense compilers programming languages why not bares and all that stuff uh but networking in my opinion I'm not quite sure if you're really going to be that faster and if it's going to matter that much you know what I mean but there are always people that's going to going to going to prove me wrong and and they're right that's a thing they right but sometimes you need to let it sink let it sink in if goang basically disappears tomorrow I don't give a [ __ ] I will pick something else I'm not married it's just an easy language I don't know what it is it's just [ __ ] easy there is nothing to write you know what I mean goang is such a small language how can you how can you not know that it's basically just a very simple C memory managed garbage collected you just press buttons and it probably is going to work okay now we need to focus up because I really want to get some stuff done 1 hour is perfect no the stream is not frozen it's just the music stopped and I also stopped breathing at the same [ __ ] time we need to do something about it okay cool is my internet is my internet [ __ ] bored you need to add me to Discord says that yeah no you need to add me on Discord just send them send a message send a message somewhere send me a message right now send a message in general hey Anthony can you add me as a friend send that now in general and I will do it right now what are people doing actually here Diablo 2 what the [ __ ] is this League of Legends guys do you need to program what are you doing what is everybody doing he playing Visual Studio code I like that playing Counter Strike this guy is always playing a game 24/7 it's crazy how long can you go without breeding I don't know man a minute or sometime I have no [ __ ] clue I'm going to test it on stream because there's nobody here to back me up when whenever something happens if I get a stroke or something I really die um the problem is you cannot kill yourself with um let's ban him hi Anthony ban get out of here uh friend yeah of course I'm going to show you the conversation that's for uh tonight I'm starting to re ReDiscover go because of your channel thank you very much hey no worries man uh like I said I'm I'm probably also going to do some other languages soon because I think I I have a lot of goang videos and I really want to expand my channel a little bit um with uh like more of I mean yeah there's a lot of audience that does not know me because they are not interested in go right but I just be honest we can be chats in any [ __ ] language you know what I mean uh yeah let's focus focus focus focus focus okay focus God damn it okay we can add P that's fine so we have p good and now so now that we have a peer in here now that we have a p how do we know when we need to what message we need to publish because he needs to do an some kind of a protocol some kind of a mating dance how we going to do that it's probably in consumers we're going to put that in so we're going to say at com and then it's fine here right uh I'm going to do something like a type a message uh coming up with this like I said on the [ __ ] Floy yeah copy paste that um we can do this yeah why is this message do we already have a message actually we do the hell huhuhuhuhuh I see what it is producer message yeah okay fine the thing is should we if we have if you have webset consumers and they want to basically communicate with the server are they going to are they going to have their own protocol they probably will right let's call this a WS message and and let's let's see maybe we're going to change that up sometimes you have no clue right but that's fine you just press a button and hope for the best later on you know what I mean uh action topic is fine so what we're going to do is each time uh let's make this message heat it's going to be a WS message we can't we [ __ ] can't promise we cannot import this right because it's a main okay we can solve that real quick close your [ __ ] eyes because it's time to not keep it dry yeah we can fix that later maybe we going to make a new package which is going to call Net or message or whatever and then we can import that over yeah that's fine don't no big of a deal guys no big of a deal uh WS message we're going to say here that the action is going the action not not not an action you know what I mean in Belgium you have an action and and the island and you can buy a lot of cool stuff there you know what I mean you can you can literally buy the whole shop and and still have money on your bank account it's crazy it's so cheap there it's it's wild you know what I mean um I I most of the time I buy my cleaning products there it's crazy it's like Mr Cleaner and then all the other stuff swiffers and it's amazing um I I buy everything on the company you know and then they say huh Miss Miss pixel huh who's that yeah uh action subscribe right subscribe and then we could say something like uh of course this protocol is not going to be the best right now right you can make it your own topic is going to be F by bus you know what I mean something like that um is it Marshall or UNM Marshall it's probably Marshall isn't it we can R Jason anony what the [ __ ] are you doing you idiot I know I completely know you could you could use this thing as right Jason you know what I mean it's like it will do it for you of course it will probably use the goang standard Json serializer and if you want to go very fast I would recommend using something like son Sonic uh or uh something else uh you have Sonic and some some other fast Json serializer in goang which I recommend using if you really want to send a lot of messages over websockets over over the wire in Json format for example uh the tech Trader trading uh project I made uh was using something like that because you need to send a lot of messages in a very short uh period of time uh but for the Simplicity we can just write Json it's probably going to return us an aor as it is uh if f is going to be this thing and if the error is of course not n then we're going to actually say lock fail out uh man anony please it's time to go to sleep something like that so what we're going to do is we're going to dial we're going to send that message it's not going to work be well it's going to work the problem is we cannot read it why because we don't have a read Loop correct so that's where things are getting tricky right you see this consumer here wait a minute wait wait a minute wait it's one connection yeah I see what it is uh of course Anthony what are you doing where's consumer here here what uh we're going to try we have still we have still time we're going to try to make that work right we're going to that's the goal to of today is basically produce messages consume messages right and then we need to the next time we need to add some more stuff in right we need to add uh commits of the messages we need to add uh consumer groups and all that beautiful stuff but first things first you know what I mean that's that's how you need to to to program you need to first things first we can minmax everything later on no big of a deal yo um yeah so this W consumer is going to have a connection which is this bad boy here right this one this this beautiful thing here wait oh man um I'm thinking I have a better idea because this is actually super weird because it's not a what else are you going to do if you dial if you dial if you dial to the server if you dial to the message Q hey hello message Q I'm a a new connection and I want to consume stuff what else do we expect nothing right we only want what we want to know is what we want to know if he dials is one what kind of topic do you want to consume or maybe topics right and what kind of what kind of topics do you want and two what is your consumer group right that's that's what we want to know and nothing more so I was thinking how because because because it's so easy we could actually use a header uh here where is it here you can actually this this guy here is a head and a header gives head according to the TIC interface implementation namings according to the goaling chapter 3.0 but so we could actually give all that information in a header and then we're done so we don't need to hassle with um dial in and then write what we want to do here but but let's say I'm subscribed this is important because you need to think a little bit further let's say we do it with a header easy peasy right okay I'm I'm I want to subscribe uh to topic F Barb bar and my consumer group is uh yapat but then we want to change that we want to unsubscribe to a certain topic and we want to change consumer group or something yeah that we have a big problem because the header is already been sent you know what I mean um how come you aren't using ACT is very good question David Kyle um this is very very good act uh question uh I can see actors coming in into play very very handy here uh this is this is an actor uh project but I wanted to keep it very normal you know what I mean no actors no different things just stand the library the most and just try to coded like the real raw experience you know what I mean um that's why y met pet it is man I mean how do you come uh uh what if we want to subscribe to new topics while they already have a WS exactly right Ashton Reef now I know who you are you little you little rascal uh that's true so we're going to do this this thing um this this this is going to be the play so how is it going to work well because normally because guys it's a consumer and a consumer only consumes but now we also need to have some kind of a read Loop to know what this guy actually want from us you know what I mean um so I think and code is on get up you can do whatever the [ __ ] you want with it right so start here consumer yeah we need to start uh the Ws consumer it's the [ __ ] pach Anthony it's the P right yeah yeah it is okay here we go again I did this things too many times and caused me so many issues but it is what it is [Music] um go Funk why you could you could some people hate gof Funk right so we could do something like this funk P WS be read Loop right this thing for can we type and then say here uh go B read Loop read Loop just like that right something like that and then return B right uh so the thing is that don't forget guys we have a go routine here we also need to find a way to communicate that this guy need to stop when it needs to stop right when does it need to stop when the connection is closed because otherwise your read Loops are going to keep waiting and you're going to have a memo relak so I'm going to say it here uh note or fix me fix me watch out for the memory leak right later on maybe no but something like that later on why because we don't know yet how we're going to do that right we I we have something in our back of our mind that okay this this thing needs to stop this spe Loop read Loop but we don't know yet how we're going to communicate that and we will never fix it probably again this is again a very good exercise if you want to how to how to think about hey this could be this could be a [ __ ] job task yo Ashton uh we are building this thing and but we have a read Loop because we need to do yada y yada um can you think about a way how we can actually stop that thing and clean up the memory if we if you're disconnected okay boss I'm on the case something like that it's a very good practice uh to figure out how to do that maybe we going to do it read Loop for p con we have a con here con do re Json it's going to be an MSG a message message uh actually to be honest we could do F it's fine going to read this message what it's going to return nothing as if this as okay cool if another uh decision what we going to do if if if if we have a f on reading the Json are we going to keep reading or you going to say yo this is this now it's enough we just going to close this thing um couple options you could say okay you can send me 10 times wrong stuff and then I'm going to kick you out of the out of the peer list uh in this case we're just going to say fmt uh pint actually we could do an um as eror I think Aros yeah uh read wsp WS spe read errors and then we can do s and say that the error is this thing right uh and then we continue you know what I mean could be an end of file I don't know minut handle message what's this we're going on safe why help I make a mistake if yada yada that's look huh it's not saving we don't have yeah I know that man WS speed handle message message actually to be honest that's fine we don't need a pointer here give me this one uh eror right see what's going on we got we're going to pass the protocol and handle message what what is going on here with these brackets man if I press enter everybody's goingon to obey exactly um right read Loop is this one so now we need to start the yeah we do it here it's all fine equilibrium is uh it's fine right so we going to do this make boom that that double check here create this screen and uh probably do this and press enter boom just like that and see what's going on okay we have a problematic problem change of [Laughter] plans now we can actually detect what the [ __ ] problem is you know what I mean it works right added a new peer handling the message and then we have some Shenanigans but that's for later on why do we have Fubar buzzit the topic we actually sent right uh we want to have topics here to be honest uh going to be a slice of strings what's going on wait uh topic we going to change it in here of course this is duplicated code I understand I I I agree I'm not him but it's fine topics slice string this thing UB Bas multiple topics why not actually subscribe why why is not working uhhuh uh-huh uhhuh let speed my friend okay thank you you see it's still crazy that the voice inside of my head is much more than myself it's I don't know why what what why how how did it happen is he reading books when I'm sleeping or something what's going on because I have no clue how how this as a thing uh handling message but we want to have uh a print F why because we're going to do this handling message and then we're going to say point to this percentage plus v so we want to know everything I don't know yeah it's fine and call it a day also we need don't forget a new line right that clear clear clear make this uh what the [ __ ] is going on this is completely other message God damn it's a WS message you [ __ ] idiots we need to fix that chat remember that make make a note this WS message and the message it's confusing right it's confusing um that's why we yeah okay all right that should be better actually yeah boom okay we have an action subscribe is fine but there are no topics for some [ __ ] reason nobody knows uh yeah that's probably because we don't have the Json again duplicate of code so bad so bad where is message here Main no server P below above consumer then topic Json top I knew I knew it was something like this make again this that presenter okay cool now we have uh action subscribe and the topics is Fubar Bas that's what we need right but then we have this uh weird error wsp read error uh that's because that's because guys I'm going to tell you why that is that's because in our code here don't use a mouse so what we do is we do this right so we say very important because this is why people going to freak out because you're never going to know what the problem is but super easy because um this is our consumer right we dial it's going to add us as a peer right uh it's going to start a read loop from this connection right the read Loop here this this read Loop right reads potential incoming bytes from here from this guy these are the same right you're calling with your girlfriend over the phone girlfriend you right but she's going to send you a message and then she says see you laters and she hangs up the phone what's going to happen here problems exactly that's what's happening so what we're going to do here is we also going to that's important because this is a consumer right so we're going to do a four again and we're going to say message no uh message is going to be it doesn't matter we can do it like in goang you can do it like this or it doesn't really matter how we do it in this case it's going to be a message and not a WS message do we have a message actually it is a WS message holy crap uh are we going to say here um the same thing right uh um a if a is going to be web no com uh read Json like this and then put the message in here it's going to be this one if the error uh L fat out we don't care actually although you need to be careful because end of files you can ignore them basically we're going to see later on how we going to handle that FM PR the message because over this webset connection is are we going to push the messages in the queue also remember so this action could be then basically message or something like that you know what I mean then we know that we are receiving a message it's like a you get the point what I'm mean it's it's it's it's some kind of a protocol to communicate between consumer and server you know what I mean because the thing is if you use libraries it's all seems so easy but under the hood you're basically writing over a connection right there is a lot of [ __ ] going on so basically thank sometimes you need to pray and sing a song for all the people making beautiful libraries because under the hood shit's shit's kind of wild right shit's kind of wild but you have no clue because normally that should be better right normally we should have a connection for the rest of our life you see no problem here you're handling this message which we don't you just print it out and here you're basically hanging on the phone right okay anti teacher in school uh told me go isn't unreadable because it's missing I think I wait and iy catch your teacher is uh basically broke because he's a teacher you know what I mean what can I say your teacher is a teacher so he's broke because he has no money because he's a teacher so he's also probably a teacher because he sucks in programming you know what I mean because otherwise he should have something like uh had a startup that just receives 8 million of funding you know what I mean uh but it doesn't but I do what you know what I mean was this guys I can't even scroll you [ __ ] look at this Dutch Revenue based finan in Marketplace levenue has waste 8 million in cies a funding and acquired Belgium based TX startup cake and it looks to scale its operation across Europe your teacher you know what I mean it's written a [ __ ] go tell him that God [ __ ] damn it go is in readable he maybe has right but still go is the most readable language on the planet you know what I mean go is very readable sometimes most of the time more than not likely if you don't use goru things and force selects and and other things that it's very readable your teacher isn't him manour your teacher isn't him no but uh take this all with a grain of salt you know what I mean think is all this a little bit of an acting going on here guys police take it with a grand assault um of course your teacher is very important right and but they are broke I'm sorry but unless they have a they have something else they have an only fans page or so but the thing is that um is there actually a language that's [ __ ] readable now all the Ruby pick us pick us I don't know man like there's always something you know what I mean uh is Dutch readable I can read it but you probably don't you know what I mean Chinese is for me it's un [ __ ] readable that language is unreadable but a Chinese he can read Chinese like you know what I mean it's like I don't know I think it's pretty readable I'm gonna lie but maybe as a point God damn it is your teacher teaching this stuff probably don't right oh what all Isam why do you prefer vs code than NE um because most of the time vs code just runs fast for me it has the Vim it basically has all Vim key bindings I need it has very good font very easy to zoom for all my videos and live streams um it stays crisp it's it has a good ter Al integration stays clean good folder integration stays clean very readable um I can install things with a blink of an eye blazingly fast would primagen say but um it's a personal preference right if you if you have yeah it doesn't really matter configuration is also much easier um yeah that's why I'm using vs code rather than VI I have in my opinion like uh the language service or for some reason I'm so people are going to basically uh debug this but the the language servers in vs code are so fast I have no clue how they do it why that is but it's so fast and in VI sometimes it's like most of the time they don't work right a new update of go language servers has left the chat typing rust language server has left the [ __ ] chat python formatting has left the chat have and Vim everything lefts leaves the chat unless you bring it back in but the next day it's left again so it's just like a continuous stress but it's probably me because I'm not him you know vs code is the only fast app Microsoft ever made yeah that's actually to I don't know why it is but vs code is is fast it really is I don't understand how it's that fast because it's it's typescript I think right how how is it how is it that fast this crazy if you let that sink in how do they do that g you need to go to definition and Vim it takes ages I don't know why it takes ages and goang I can just press boom it's like it's even faster than I can type it's it's insane how is this even possible boom boom boom it's crazy it's like there is no latency it's like playing League of Legends in Korea it's crazy it's like five ping or something it's insane um anyway moving on okay so we have sent a message so now we my eyes man where is where's handle message here uh normally we going to do some validation here right we're going to do some validation and determine what we going to do are we going to subscribe are we going to unsubscribe what kind of topic multiple topics yada y y in this case for our first MVP for our first test case like we GNA launch our spaceship as a test flight we're going to assume we're going to subscribe to the topic we gave right that basically means that we need to we have topics and each topic has a storage right let's do something like this I'm going to do topics uh which going to be this right so we're going to have a function which is called at Pier to topics which we going to call here because our wsp do we have the server here please no we don't have the [ __ ] Ser we don't have the ser and that's where you're going to have it either's going this what what I'm going to do right now you're either going to close your eyes or you're going to shut up right it's one of the twos right because what we're going to do can be very bad but with a little bit of luck it's going to work out very fine also in the future but we still do not know that if I would give it a chance I would say it's going to give us a 30% chance we're going to be fine for the rest of the series so that basically means that there's a 70% chance we're not going to be fine but we don't know yet when that's going to happen because now we're going to have some kind of a dependency how do we call that a dependency spiral a little bit of react to be honest where you have these components calling components you know what I mean uh like a state problem State Management that's what we need um because we need to have the server right and the thing is the server is in the consumer the consumer makes the peer that basically means that we can put the server in the in the pier why because we going to yeah we need to we need to there's no other task task three three that you can do is think about a better way on how we going to communicate between consumer stuff and then server peers adding to topics most likely it's going to change right like I said most likely this needs to change but I don't want to make the decision to spend time on thinking about that because that's going to take me at least some EXP mentation and probably going to be an hour in because it's important and you're going to try some stuff and think about that but that's boring in the Stream So what I'm going to do is just do what I do best and that's is is writing uh simple things um yeah this is so bad guys why what what what what does a server and a peer well actually if you think about that a server and a peer yeah some some kind of intercon connected you know what I mean no isn't it damn the Twitches are [ __ ] left behind what up people what up twitch hello bash X how many people do we have no Anthony we stay focused think about it we have a peer that peer want to wants to want want that P sends something to us to our local version so we can handle upon that but the pier is a separate thing the server is a separate thing a server has multiple peers but the peer needs to communicate to the server what it wants to do doesn't makes sense if you think about that it's all fine so we're going to say server it's appointed so it's it's fine it's just a pointer you know what I mean who's going to who's going to change the server at the run time who's going to do that what kind of videot is going to change the server at the [ __ ] run time why exactly nobody's going to do that you know what I mean even not your school teacher he's not going to do that so we're going to say server server you know what I mean and call it a is going to be S yeah so what you could do is actually say something like that like I said we're going to assume that this is always going to be okay if message action uh why why I'm doing brackets the [ __ ] is that um subscribe right P ser add peer to topics MSG topics it's that [ __ ] easy it's that easy it's it's it's it's just that simple look at that it's like a puzzle it's like a puzzle and we it's like a diamond painting puzzle you know what I mean and we just completed it 1,000 pieces holy crap VC is on yeah yeah yeah already read that notification I'm going to lie guys but hey this like these these these message CU streams I I feel a lot of I feel productive I swear let me know in the comments let me know right now in the chat what you think about that because like I said this is not the this is like I said if you understand how to build these things things and to come it's not so to say like it's the way of doing things you know what I mean it's like shoving the right puzzle pieces at the right moment do not do too much but also do not do too less and you know because beginners are going to have a going to have a lot of problems with that because they are not stupid right if you're if you're only let's say you have two years of experience or three years of experience of one year or 6 months you're not an idiot you know what I mean you're not an idiot the problem is that you are afraid of taking these steps or taking certain decisions because you think they're not going to be good but I mean if something works is it bad I mean I don't know man I mean if I need to knock you out if I knock you out with my with with my with my [ __ ] hand or I knock you out with the these two Knuckles here you know what I mean if you're knocked out you're knocked out you know what I mean doesn't really matter you know you're knocked out if you're knocked out by a [ __ ] slap Ah that's questionable but you know what I mean you're you're down it's over it's GG the same thing in programming you do stuff you make things happen you make a decision and you trust it and you go for it and later on in the in your program that's what happens with me is like after a couple of sessions it's like oh [ __ ] I [ __ ] it up right this spear thingy we did that's not going to work so I made a mistake right but then it just refactor it you know what I mean and then you're going to learn that from okay I did this pattern with the speed thingy well it didn't work out so it's probably not going to work out for all my other projects in the future you know and by the end of the day I mean this is not your job job you know if you build something in your free time you want to go fast it's like speed coding you know what I mean you want to build a message queue it that that that thing takes six months to build before you know what I mean it's not easy if you want to make a prediction ready message queue that people can use it's going to take you months tests and you need to do a lot of stuff you know what I mean but this is more of a speed coding stuff where you have a couple of weekends you have this couple hours in a weekend two hours Friday one hour Saturday boom and maybe one hour in a Sunday two three weekends and you have it built is it can you basically deploy that and and and and and let Microsoft use it of course not but at least you have a lot of [ __ ] experience right you know what I mean uh it's going to work that that's for sure 100% sure this thing is going to work the question what it is yeah there's a lot of things that needs to be minmaxed you know what I mean um wait what I'm it's so hard but I'm getting so good at picking up the the the wir man it's crazy it's like um yeah the server thing yeah yeah yeah yeah so we send it then we going to the p is going to if it subscribe we're going to add this topics here so I'm going to perfectly fine that's what we need we're going to do an fmt print here no it's not true we're going to do an asog info with the uh adding P to topics topics topics it's that easy you know what I mean it's just the same thing they're still calling with each other we're going to break that connection right now uh clear and then oh I'm spitting again I press this boom and then we're going to have oh it's so easy right guys this is no no big of a deal right so uh adding P to topics topics is f baras true that's what it is right um so the the moment we so it's very now now we need to think about that so how does a message Q actually work well you're going to each time somebody is going to publish to the message Queue at a certain topic for a certain consumer group let's big the consumer group out of equation right now if somebody publishes if somebody publishes F to the topic theit the B the topic one if somebody publishes food to topic one then one we need to notify all the consumers to topic one of topic one topic one but let's say we are we are sending integers from 1 to 10 and we are at and we are already at 10 so we have 1 2 3 4 5 1 2 3 four 5 6 7 8 nine 10 I guess but we are just dialing in as a consumer which basically means that our offset is zero so we need to one keep track of the offset but that's for a consumer group that's not per peer that's per consumer group in my opinion we need to start sending all these messages at already in the queue if we are if our if our offset is zero if that makes sense so we're going to assume that this peer for now we uh because we don't have the consumer group consumer group principle and the committing that's probably for the next uh stream we need to send all the messages I PE to topics but you just have topics what what the hell is even that you need to PE right uh send all the messages from the peer offset to from the P offet off set is that true right actually to be honest I'm going to I'm going to take P first here and then topic you know what I mean makes more sense I did it like that what the hell is dead I'm him all right how are we going to do that for now what headphones are are we using uh Stefan that's the what the [ __ ] am I using oh yeah it's the Sony wh um 4 Series I guess the four Series yeah four or is it three I don't [ __ ] know three or four the I think if if there is already a series 5 it's the four and if there is no Series 5 and series 4 is the latest Series 3 I think it's the series 4 by the way amazing headset this headset is the best I ever had it it's on it's over ear it's noise cancelling it's perfect Bluetooth is amazing the quality it's crazy it's insane it's just the best headset I have ever had on my [ __ ] head I swear to God so it's it's probably this right the Sony wh is it that for something like that just Google it I think it's around 350 or something like that Euros we're going to assume for now that the offset is zero that basically means it's a fresh consumer right didn't consume anything Zer is consume anything so now we need to go to s store get store for topic we have a function for that that's insane store add probably we need to have multiple topics so we're going to do four underscore topic and range topics go unreadable it's readable right four underscore what the hell is even that nobody knows topic colum equals range topics it's kind of okay right um we're going to say store R is s get store for topic topic if add is not nil of course because it's go line uh we going to yeah what we could actually know that's add beer to topics if a beer subscribes to a topic that does not exist we uh agreed in the previous stream we going to lazy knit that topic the question rather it is is it doing that it's exactly doing this right that's beautiful that's amazing that's just that's why there's no eror probably in this thing correct um that's why I'm all that's why I'm so exhausted all the time because I have multiple personalities inside of my head talking at the same [ __ ] time to myself so I'm thinking for two I'm speaking for two this is insane that's why I'm so exhausted now it makes all sense I was wondering what's going on with me for a very long time but now I know there just multiple people inside of my head's crazy yeah it costs a lot of it costs a lot of money but I mean guys like I said man do me a favor if people following me for there are of people here for that following me for a very long time I mean if you watch all my videos you don't need to watch all of them but these Concepts I mean if you should know that already right if if people are for for a year do me a favor are you making progress are you making progress at your life like job-wise because even this is going it doesn't even matter it's like if you these these things work in every language basically you know what I'm I mean it's like it's like puzzling it's like a puzzled that's what you need to do right if you make a puzzle each puzzle is different each language is different but by the end of the day it's training your I don't know man I I cannot imagine that people really want to learn and really trying their best following this stuff you should have a good job with a lot of money oh I know a lot of my following is from India and all that stuff or from from from a from Africa from Africa which it's not easy to be there I understand that right we as Western people we we we are so [ __ ] lucky right I mean we got born with a laptop shoved in our [ __ ] ass you know what I mean but these people in these land in these in these countries they they need to do with way less they have way less opportunities you know what I mean and uh I just want to say for the people that are still grinding because I know there are a lot from my emails and and and my DMs from the people that live in these countries where it's difficult war and all that stuff but still finding the courage to learn as is insane that's actually crazy I I really respect that because I think I wouldn't that that's that that that's crazy but I would recommend because they say yeah but in India I don't earn that much I know that but I'm I'm I'm 100% sure right that if if you if you know these Concepts if you know what I'm trying to teach actually you should find a job outside of your more in Europe or something where where where the the wages are higher the problem is that I know a lot of EMP I we don't make it we don't make a difference at laue if you come from the poorest country in the world and you're an engineer you got to get paid like everybody else right oh but he's from India or he's from from Nigeria we're going to pay him less that's why they hire people from there and I think that's so [ __ ] bad yeah but they they they life is cheaper there yeah but that doesn't work like that you know what I mean like I'm I know that I know that money is the motivation and I know also know that money is the conversation so if you are a [ __ ] company if you are leading a company if you're you're a CTO or whatever in a company in in in in a in a in a better country and you're going to hire people from these other countries which do the same [ __ ] work with the same [ __ ] brains and you're going to pay them peanuts man get [ __ ] you know what I mean that's bad but I know there are companies that that doesn't that don't do that and you should basically find the strength to basically search for these companies and get paid like you should be paid I swear to God you need to do that because you got to yeah you need to do that and that's life-changing money for these people that's life-changing money because if you come home with 8K a month or 10K a month you're [ __ ] you're you're a king you know what I mean you're the [ __ ] King in these countries um people need to be treated um based on experience level we can all agree about that we have people that are just starting out fine they climb them up on the ladder but that doesn't matter if you're [ __ ] black white purple whatever [ __ ] gender you have or whatever [ __ ] country you you live in you should earn the same thing and that's simple and we because I and at L we don't make any [ __ ] difference right I don't care if you yeah everybody makes the same amount of money some people will will need to spend more in their country because the Netherlands is is is is expensive that's your problem and some people will going to come home with a big pile of money because in their country it's it's it's life is cheap but the life conditions are also different you cannot uh compare that right you cannot compare the roots you cannot compare the infrastructure you cannot compare hygiene you cannot compare all the stuff uh security um in these countries people forget that sometimes right we as westerns uh like I said we we we are born on a [ __ ] blank sheet and nothing happens right bum an iPad shoved up my ass you know what I mean food for days clean water nothing happens you know what I mean people cannot make a sound after 10 because then they're going to call the cops you know what I mean but in these other countries you're not you're basically born between bombs right you're born on a [ __ ] rock with nothing you know what I mean that's crazy sometimes I think about that sometimes I think about that sometimes I let that sink in how these people need to live and still find a way and still find a [ __ ] way to be to make something from their life that's actually crazy not going to lie congrats to you man that's crazy anyway we have a store get store for topic why is it not working a Storer yeah this is Aros we don't have an Aros right we're going to create the topic lazy so what what I think we need to do is find and I'm we going to where can I apply uh you can you can maybe soon guys I yeah like I swear if you learn the stuff watch all my videos over and over and over and over again copy what I do and I swear there is it's impossible to not find a job it's impossible and the first thing you say is okay mister I come from this County but I don't [ __ ] care you're going to pay me as much as the rest that's what we need to do you see let's spend some time on here because I think it's [ __ ] important sayot n narian here it's hard uh they pay 80% less than the same amount paid to be to se in develop developed countries because they are always someone to take your position I'm thinking about the last statement because there is always someone to take your position that's true but it also counts for me right because we can I can feel myself powerful and I can you can feel yourself confident and you can be good but there's everybody everyone is replaceable in some way right but that's what I also say on a lot of streams the problem is I cannot make these some people are not that's what I say on a lot of streams is that you need to have also a lot of other skills how do they call that soft skills right you need to some somebody's very valuable in a company like I I would I will pick the less experienced developers that can think with me and can be creative because to be creative and to think to think about Solutions you don't need to be a senior a child of six can think about Solutions right that's what we do right if you play with Lego right if you play with Lego or something else you're playing [ __ ] RuneScape as a [ __ ] child or Roblox my son is 6 years old he's playing [ __ ] Minecraft and Roblox he's reading English I never teach them English he cannot even read right but he knows how to write camera he was typing camera on his [ __ ] iPad in Roblox because he want to change his costume to with a camera or something and I was watching it what the [ __ ] how the [ __ ] did you learn that camera camera he was writing that with his finger was crazy was he's six years that's because he's playing games 247 right so everybody can think and I will pick somebody that can think and can be and is willing to learn learn and know how to talk how to sell how to come up with ideas over always over some Guru developer that knows the details and knows pointers and oh watch out for this because this memory layout needs to be different and at peer to topics you cannot do this string thingy because that's bad because it's NOP you know what I mean he's a very good developer and he knows everything and he's pretty fast and he's good and he can test and he's just amazing but he's that's the only thing he can right so try to be very versatile in your life um that's very important because with with being very good at programming alone you're not going to you're not going to make it right or you're going to yeah maybe for Google or something or but that's a boring life I think working for Google but that's that's that's what I think uh um no one is hiring Junior deaths but the this Market is saturated as [ __ ] right I mean man I I will make a video about this because I think it's important I think I also have a video in the fulltime good have about that um but um what's going on here no my brain is two hours and it's G you know what I mean it's time for some nicotine or something I don't know what's going on wait I'm going to let me store so we have the store and then we actually need to find that's the next thing we need to do uh probably in the next episode is find uh the store dot uh something like a l we need a l function here so we're going to call store L right and that's going to give us a number right the size or something right and then we're going to Loop something like uh Forge size I think I'm just trying to mock it out right and then we're going to get all these messages store get right we're going to get this y right and then we're going to basically write the D the WF something like this but we don't care about the a for now because we're mocking it out now we going to see um we're going to get all the peers right we're going to loop again over all the peers right and uh range peers right right P code and then we going to PE sent B right that's that's that's that's in in Gross lines in the big scope in in the grand scheme of things what we're going to do is and then we have basically an end to-end system that works you publish you consume right but then we need to do the the details right consumer groups offsets commits and all that stuff right um and do some other cool stuff and then we have basically a [ __ ] message que right you can deploy and you can use yourself easy peasy right it's the same as Kafka it's exactly the same there is no difference you know it's like you can do PBS up you can do uh it's it's full tolerant because you have an offset that you need to commit so you're going to and then you can make it better you know what I mean add more transports uh testing things make it faster whatever you want to do with that right uh so but for jobs uh let's talk about that a little bit it's basically um so you need understand if if you check Twitter how many of these SC I'm not go do I call it scammers but it's like they back in my day programming was a real job of course today still but but it was a job you were oh you're a programmer right but now it's it's more of a lifestyle that's being Advocate advocated as being the by influencers right programming is suddenly turned into this lifestyle with MacBooks and uh Nomad lifestyle where you can program everywhere and and and and it's all easy and it's all uh rainbows and unicorns and we use react and all and it's cool and but the problem is that that creates a lot of hype but I think before Co there was a lot of VC money involved in to the tag scene right it was it was booming right people were dumping money in all these startups and it was a big big um like I said it was a lifestyle on Twitter it was crazy people are are recruiting people and and it was insane but now it's not anymore right because people starting to realize that it's not that easy you know what I mean it's not uh a wake up and I'm uh chilling in uh how is it call I'm chilling at McDonald's with a coffee and a I'm coding this cool cool thing no that that's not what it is you know what I mean um yeah you need to if there is a job open you need to understand how it works right I already explained this it's like you send your resume but why would everybody's sending his resume there's 100 resumes who's who are you going to pick you know what I mean hello hello sir I saw your job opening oh it is very cool company I feel the same and I want to work as a software engineer I have one year of experience and I have some uh boot camp follow and get her profile nobody's going to hire that right you need to [ __ ] lie you need to fake it till you [ __ ] make it man you know what I mean stop sending these [ __ ] things remove Junior from your [ __ ] uh thing you need to [ __ ] fake it till you make it but you need to invest 10 times the time when when when when you when you actually landed a job because they're going to hire somebody that does that that that is not what they want at that time you know what I mean so you need to spend extra hours at home to learn and to because you're going to be slower you need to learn these Concepts but you need to you need to invest that time extra but if you're going to say exactly who you are and I know this sounds very weird and people going to hate me for that but if you going to say exactly who you are they don't know you right they don't know your heart they don't know how hard you want to grind for it how much extra hours you want to make to come to to to to basically um get the knowledge you need they don't know that the only thing they care about is what did you do before and what is what are your studies for example right and pro most of the time you're not going to be a senior developer with a lot of experience most of you guys are basically just I don't know maybe two years maybe one year maybe five years or something maybe you know what I mean I think you need to be a little bit more Brave and a little bit more risky and you don't need to lie but because lying you will you will basically get caught anyway but maybe you need to make it a little you need to make it sound better than it actually yes right because maybe you are maybe you are better than you actually than they perceive you right so remove the Junior from your resumes remove all these all the things that do not matter remove them from your resume but the more you the more you put on that thing the more stuff they can fall over oh Junior here junor there's a junior next CoD it in PHP coded in pyal next because you need a go developer or something you know what I mean try to craft your resume based on the job you're trying to land I know it's a lot of work because if you want to have 50 job uh then you need to have 50 different resumes at leue I don't care about a resume I never ask one I don't care because I'm from a principle that the only way the only way someone can know if you're good or not good is to work with you right because you can say whatever the [ __ ] you want I've been there I've done that so I know so I just want to have a conversation about stuff like here on stream and then we work and then we see right anyway are there any questions Western Outsourcing has been a result for our eies correct right uh what you see a lot also in in in Europe here is they just hire uh oh we have a project uh we're going to hire 10 Indians I know it sounds weird with we're going to hire 10 from India some some some outsourced company with 10 in from India and they cost nothing but they do the same job you know what I mean it's crazy it's I I don't understand that um and by the way if you yeah it's it's easier set than done from my perspective here actually but I mean what is going to stop you what is going to stop you to try to do something yourself you know what I mean what is going to stop you instead of sending a resume is sending a bug fix let's say you're unemployed let's say you go to school or something or you're unemployed you have nothing to do or maybe you're employed you work eight hours right I know you work eight hours but you're not happy so you basically come home and you have 4 hours left why not try to find all the companies you want to work for visit their websites try to find something try to see what they're doing try to find mistakes try to find potential solutions for the pro for their uh application you already have build something doesn't need to be pinpoint Perfect Just say Hey listen um yo my name is uh Ahmed uh I've been coding for all my life maybe you're 24 who cares I've been coding for all my life me I've been goinging from my 14 or 16 tell them tell them something like that been goinging for my 16 listen I saw um I've been looking for something for something else and um yeah I came across her company I think it's cool it's it's it's it's interesting although I don't know the details yet but I looked around at your website I also tried to sign up for your uh trial uh thing and I saw maybe a future that could be interesting because this is what we have right this is what you have right now but I mean let's think about the customers perspective if we Implement that future would be nice right and I had some free time and I thought yeah why not make an MVP for that so this is what I have you know it's written in react it's written in F kit um with a python back end or a goang back end uh but yeah it doesn't matter because I write basically every language uh because that's what I do in my free time you know what I mean I don't like to go to uh hang out with my friends I like to code and and and read and learn uh yeah when do we meet tomorrow at 4: or uh Friday at 1 it's that easy you know what I mean they probably already hired me the company that I don't know what it is that's what you need to do clip this thing that's what you need to do you need to be proactive right because everybody is sending his [ __ ] board resume you know what I mean the same thing over and over again no proactive you have four hours a day if you're if you're employed so that basically means every day you find something you make something and you send an email with a with a thing or you call them or whatever the [ __ ] send them an email because I don't know you don't want to call because you don't speak yet that's something you need to learn be proactive right make something already for them right do not come up with your [ __ ] Netflix clone do don't you dare to come up with your [ __ ] uh whatever clone Twitter clone you're making with your with your framework no you make something for them but I don't know yeah I don't know either they probably also don't know you come up with something that most likely is going to work do some research check out the competition yo listen company x uh I see you have a job opening for a front for for for an engineer for a fo stack for for whatever listen this is your competition I inspected their platform and I saw you have this future and you don't have but I have some [ __ ] good news because I already implemented that future here is a here is a version here's a demo how hard can it be that's what you need to do man and I swear to God that this works all the [ __ ] time because nobody's doing that you're the only one that's doing that I swear to God that's the only one that's doing that you're the only one if somebody would do that for Le you and say yo listen guys this this is your app it's it's terrible it's the UI sucks but I have enough solution because I recreated that thing here here it is here is the figma file here is the spelt here is the the endpoint hosted on versal here is everything here are your credentials you can log in and check for yourself if somebody's doing that and it's [ __ ] insane man I swear to God I fly to whatever [ __ ] country it is and I'm going to pick you up with a [ __ ] with a limousine and drive them back to here and pay you a [ __ ] ton of money because nobody ever did that and probably nobody won't you know what I mean and that's that's what people you need to be proactive try this out I swear to God try it try it out maybe we're going to try it on stream maybe we're going to pick some random company maybe that would that would be an insane uh YouTube hit we're going to pick a random company and we're going to rebuild something and we're going to try to get highest under a fake name with a fake picture a i generated you know what I mean and see how how fast you going to get a job are we going to do as if we were uh 22 year old [ __ ] from a third world country with zero to to non experience but if you come up with something that they can see and feel and it's amazing they're going to hire you every single time and then you need to say yeah that's fine but you're going to pay me exactly the same amount you pay you pay the rest simple and it's so easy not in your sound that's true and it's so easy with all these with all these packages also guys it's [ __ ] easy we are building things from scratch you don't need to do that right this is just for learning experience but if you really want to do something like you can build with with all these tools react I don't just don't think about spell just use [ __ ] react or something or PHP a lot of Val you boot something up you download a bunch of packages and it's all being fixed for you you know what I mean you don't need to know CSS because there is like chat CN and it it's all happens automatically you just download stuff and you can deploy it in [ __ ] two hours is let us be honest it's not it's not difficult you just need to be brave enough to do it I swear coming up with your with your lead code stuff and everything that's not going to help right nobody cares I don't care about lead code I am aite code master yeah [ __ ] you I don't I don't need you you know what I mean I don't need somebody that makes [ __ ] binary trees I need somebody that can [ __ ] think build stuff for customers and and and make cool [ __ ] you know what I mean and then there is the Imposter syndrome that was some Junior uh I'm sorry for the people on Twitch that I I don't know I need to merge these chats for some [ __ ] reason I don't know what it is here um God damn it but somebody needs to try that out guys I know it should work I swear to God I mean maybe I should do it just to prove you just to prove you we should we're going to pick some companies we're going to check how bad they are doing and we're going to make them better and we going to even they don't don't that's guys they don't not even need to have some some job opening open if you can show that you're basically better than the whole [ __ ] team by making something by doing some research and by by checking the competition and add some so kind of a future feature for them man these guys going to be mind blown the first the first one you're going to fire is James at a [ __ ] water cooler and you're going to take his place you know what I mean I swear it's impossible I have company I know that I know it's it's work like that what is your view on spelt good it's very good but like I said before spelt does not have a a super rich ecosystem which for me on stream or for toy projects does not matter but if you're a company um and you want to go fast and Fast and maybe react is has a little bit of a of the edge here but I like spelt more from a programming perspective yes I don't like uh react anymore uh you what the [ __ ] is that that's crazy I I just got an offer uh on open C which I never touched for years and somebody had an offer that's crazy what are you going to buy I don't have any any decent I don't even have my [ __ ] uh private key anymore maybe somebody had dropped something special you know what I mean like uh oh but what is your opinion on on this if you don't know how to c by yourself you can't design good systems but but the world doesn't work like systems you know what I mean like all the crazy systems you need to design already exist message Q exist all [ __ ] binary threes all complex stuff already exists you know what I mean there's nothing to solve there's nothing to create anymore right distributed uh databases exist key value stores exist PBS up exists uh cryptographical stuff exists every package for every self balancing Binet exists uh everything exists every complex thing that's that's the thing every complex stuff exists there's nothing you can invent anymore unless you're [ __ ] Einstein or opener but that's fine that's not our job as a programmer we are not researchers we are not scientists right we don't invent these binary Three Special Concepts block and minus one we don't care that's cool on the prim is and stream to learn about that stuff but we don't care about that because that's not how businesses work that's not how the world works right some smart some smart kiddo some smart some smart guy will figure something out we'll make something faster and we there's going to be a package and we're going to use that that's how that's how it is right cool I'm not I'm not smart for that I cannot do that I'm not I'm basically dumb I cannot I'm not not as smart to do that stuff so the only thing you need to know is how to compose stuff from the things that already exist right companies don't need complex stuff most of the time they don't need complex stuff the only the only thing the only thing they need is is people that can is people that can implement or solve problems they have in their business you know what I mean for example and then I'm going to going to quit the stream for example at laue laue one of the most important things at laue is underwriting right and under writing is basically that somebody's goingon to try to trade his subscribers in in return for upfront cash but in able to do that is think about a loan right if somebody wants the loan you need to underwrite that loan you need to make sure that the guy or that the company that want that wants to have receive a funding want to receive money that he has credible to pay it back that it's not going to default in order to do that we basically have we try to gather their subscriptions from the subscription manager or a CSV file we try to F uh fetch accounting information accounting like a general ledger and then we also look into the bank statements over psd2 connection so we have three sources of TR truth the subscriptions because it's recuring Revenue companies they have subscriptions recuring Revenue accounting data general ledger and bank statements Bank transactions if we use these three components together we can actually verify we can basically um how do we call that um double check double verify if it's true what they saying if they can actually have that loan if if if their credit work if we can underwrite that so the problem we have is that the users as a company so I'm going to give you a [ __ ] problem so if you want to [ __ ] solve it no problem you know where to find it right because I swear to God if you come up with something good you're the first one in right so the problem is that a user a user has multiple they can have stripe for their subscriptions they can have recurly charge B some some some have none right some oh we don't have that it's all in our accounting software uh oh so it's difficult to get these subscriptions because because every [ __ ] user has something different you know what I mean I thought everybody was using stripe no it's not they everybody uses everything so we come up at okay cool upload a CSV file go to your [ __ ] subscription managers and make sure you export all your [ __ ] subscriptions into a certain format the same thing with a bank with the bank statements uh with the accounting statement we said we're still not sure how we going to we do it all all manually but the the the goal the problem we have as a company as we want to automate that we want to automate that we have a list of subscriptions the bank account that's already done connecting to bank accounts that's where the third party thing that PS2 it's that's fine the bank accounts uh the bank statements and then the accounting general ledger to make a balance sheet put these things together and come up with an analysis automated without any single human interaction that's the hardest part that we still not have solved to do that that's a problem is it is is is that a is that a crazy architectural problem no but that's a that's a billion dollar problem you know what I mean so people are focusing on oh I need to know everything about distributed systems and no you don't because it already exists if we need a distributed systems okay then we will find something right there is C we can do whatever there are so many solutions for that right if we if we need to store some data in a [ __ ] special binary three where that basically also wipes your ass if you're sitting on the toilet fine it's probably already been written we don't need to do that but we need to do as Engineers to make our to make to fill our [ __ ] bags of money is to solve problems and it's actually as simple as a file upload but we need to pass it how do we going to pass it how we going to set the columns what columns how do we know the user has the right columns we have a general ledger we need to go to a balance sheet what do we need the general ledger is every [ __ ] accounting see software export the same general ledger do they have the same Fields is it the same format how we going to fix that that are problems we need to solve and not all these performance increases and this and that and yada yada yada that's all [ __ ] right that's completely trash that's all fake it's a scam it's a lie because it already exists and nobody's going to hire people to make that right no no there's the majority of the companies is not going to hire you to make this crazy [ __ ] because they already use stuff that already exists right people are goingon to hire you to solve these these difficult problems will you save the record of this live yes every live stream is saved on Twitch but also on YouTube think better please watch this on [ __ ] twitch man uh what no sorry watch this on YouTube that's that's that's my channel guys I'm going to wrap it up I'm going to wrap it up I hope uh there's a lot of information being said we have a good coding session also it's crazy right I'm happy I'm hyped uh yeah it's nice I'm very happy actually uh I want to thank everybody here uh we are almost 30k subscribers on YouTube so I want to thank everybody supporting me um like I said without you guys I wouldn't do this right because it is what it is um yeah all right hey re out on Discord uh if you want to reach out to me no problems um wish you a very good evening you know what I mean um
Info
Channel: Anthony GG
Views: 7,982
Rating: undefined out of 5
Keywords: golang, go, rust, javascript, typescript, cpp, python, microservices, metrics, vim, vscode, programming, web development, learn programming, neovim, nvim, monitoring, prometheus, grafana, software, software engineer, software engineering, development, engineering, programmer humor, software memes, web design, web developer, developing, computer, developers, vscode engineer, backend developer, software developer, web developing, vscode vim, computer science, js, coding, algorithms, software interviews
Id: 4EqsQzLQy_I
Channel Id: undefined
Length: 149min 49sec (8989 seconds)
Published: Thu Nov 23 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.