Can you Cancel a REST HTTP Request?

  Рет қаралды 4,098

Hussein Nasser

Hussein Nasser

Күн бұрын

Пікірлер: 28
@yeesh2630
@yeesh2630 4 жыл бұрын
Hey Hussein Great Vid! I wanted to give you also a heads up that within the go programming language there is a context package in the standard library that is also built into net http library. From the docs it states that: "the Context type, which carries deadlines, cancellation signals, and other request-scoped values across API boundaries and between processes". From typical usage you spawn a background context object and embed that into all subsequent http requests paths. For example if a user is connected through a websocket connection, or sends an expensive http request and then closes their browser (or some other defined actions that signals a stop), you invoke a method on that context object that sends a cancellation signal that propogates across all the function paths and cause them to return early and stop the operation.
@harshavardhan9991
@harshavardhan9991 4 жыл бұрын
Thanks for adding KZbin chapters.. I will always come back and watch chapters that I am not confident.. 👍
@kafirboysrock
@kafirboysrock 4 жыл бұрын
I like such thought experiments. As engineers this is the most underrated skill one can have. But it's the most powerful one. Please create more such videos, you are a good teacher just like Feynman.
@soumyadeeproy6611
@soumyadeeproy6611 4 жыл бұрын
man ! Can you make a video on how to work with wire shark and analyse network traffic ?
@KashifMinhaj
@KashifMinhaj 4 жыл бұрын
With grpc and Go, it is easier to implement request cancellation. Go has built-in concept of contexts, which you can check after every atomic operation to see if it is cancelled.
@TenderBug
@TenderBug 4 жыл бұрын
Thanks for this eye opening explanation
@naceriomar6484
@naceriomar6484 2 жыл бұрын
i'm searching for this a long time
@ankitsaiyan6151
@ankitsaiyan6151 Жыл бұрын
I have imolemented it using context cancel in HTTP2 requests in Golang
@sariksiddiqui6059
@sariksiddiqui6059 4 жыл бұрын
thanks for the video man, how come grpc can cancel request and http2 not,when they both use multiplexing?both have a handle on request sent,right?
@hnasr
@hnasr 4 жыл бұрын
Siddiqui Sarik great question! That is because gRPC has access to low level HTTP/2 API which allows control at stream level. This low level api doesn’t exist on browsers or vanilla HTTP/2 apis. Client libraries take care of multiplexing out of the box. Hope that make sense
@sariksiddiqui6059
@sariksiddiqui6059 4 жыл бұрын
@@hnasr that does make sense,so in terms of browsers adapting to grpc,they will have to tacke this issue and implement more native low level http2 apis
@hnasr
@hnasr 4 жыл бұрын
Siddiqui Sarik correct! Thats another reason why gRPC are not on browsers yet.
@alejandroloaiza8426
@alejandroloaiza8426 4 жыл бұрын
Can you do a video for http3 vs http2?
@hnasr
@hnasr 4 жыл бұрын
Sure! I am yet to make a dedicated video on H3 meanwhile check out this playlist kzbin.info/www/bejne/ZoDVnn55d5WIqLM kzbin.info/www/bejne/nIeugaV6p6qqiqs
@noahwilliams8918
@noahwilliams8918 4 жыл бұрын
"Cancel what dood?" needs to be a shirt 😂 with an HTTP 418
@alexsh.8080
@alexsh.8080 4 жыл бұрын
Very useful
@hnasr
@hnasr 4 жыл бұрын
Alex Sh. 🙏
@yasserakbbach7342
@yasserakbbach7342 4 жыл бұрын
Does it really worth it? HELL NO 🤣🤣
@cali4484
@cali4484 2 жыл бұрын
Disliked 👎
Is there a Limit to Number of Connections a Backend can handle?
18:43
Hussein Nasser
Рет қаралды 34 М.
When to use HTTP GET vs POST?
21:10
Hussein Nasser
Рет қаралды 31 М.
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Their Boat Engine Fell Off
0:13
Newsflare
Рет қаралды 15 МЛН
gRPC - The good, the bad and the ugly
15:52
Hussein Nasser
Рет қаралды 4,1 М.
HTTP/2 request smuggling (explained using beer)
7:28
PortSwigger
Рет қаралды 20 М.
Load Balancing in HTTP/2 Explained
15:42
Hussein Nasser
Рет қаралды 8 М.
When should you shard your database?
21:20
Hussein Nasser
Рет қаралды 80 М.
How HTTP/2 Works, Performance, Pros & Cons and More
22:45
Hussein Nasser
Рет қаралды 110 М.
When do you use threads?
29:36
Hussein Nasser
Рет қаралды 23 М.
Thank you mommy 😊💝 #shorts
0:24
5-Minute Crafts HOUSE
Рет қаралды 33 МЛН