Пікірлер
@joelstevick1533
@joelstevick1533 2 күн бұрын
Nice video!
@hyakuheli
@hyakuheli 4 күн бұрын
what happens if the server is created with multiple processes (for multiple cores) with uvicorn main:app --workers 4. The first 4 clients are given a new process? or it can be either a process or another thread if a thread is in a non-blocking task? and what happens when there are more than 4 clients at the same time in this case? the new clients are assigned to threads randomly across the 4 processes?
@PriyankRupareliya
@PriyankRupareliya 5 күн бұрын
This is very valuable content. New job, starting to work on FastAPI. The whole python paradigm is new for me. This video helped clear one of the most critical concept for me. Thanks brother.
@adityahpatel
@adityahpatel 15 күн бұрын
2 and 3 look the same. hello of each is printed first then bye from each. how is 2 and 3 different? its not explained crystal clearly
@RaadClub
@RaadClub 17 күн бұрын
Thanks man.
@ArulMuruganAS
@ArulMuruganAS 23 күн бұрын
its working as explained in unix but for some reason its a different behavior in windows
@harikrishnanb7273
@harikrishnanb7273 23 күн бұрын
is there a english version?
@startup_cult
@startup_cult 29 күн бұрын
this is such an underrated video
@ashwinabrahamjacob525
@ashwinabrahamjacob525 Ай бұрын
great video
@diwakardayalan
@diwakardayalan Ай бұрын
Excellent…can it create mock test involving AWS services?
@rainbowrunner1136
@rainbowrunner1136 Ай бұрын
Hello, great video. I am super new to python. And started using very recently for backend where its being used along with FastAPI. Can you please tell me what are some concepts/ topics which I should be aware for developing efficient code. For eg from this video, I learnt that which function runs concurrently and which doesn't. I had no idea tbh about this before. If you could spare few minutes and share some stuff which I should know it would be great.
@apefu
@apefu Ай бұрын
I have so many questions, I am so sorry. Should you pass app to the AsyncClient() as well for the ASGI server? Also, how would the last example affect APIRouters defined in separate files? How would they reach app.client? They could have their separate lifespan function but wouldn't it be prefered to use the same object? Also, I don't know, but wouldn't it be better to use app.state.client? Oh, and what about POST requests, would you still use the Request object to reach the client? It works, but it gets messy code wise.
@rohit1kumar
@rohit1kumar 2 ай бұрын
got any benchmarks?
@Gameplay-ps9ub
@Gameplay-ps9ub 2 ай бұрын
Well issue with this kind of libraries imho is, that real life code is not a single module separated from everything else. It's much bigger than that and has a ton of dependencies and/or setup and tear down required. Some tests require quite a lot of fixtures and some of those fixtures are configurable as well. Conclusion is...I'd have to change manually great majority of that auto generated tests to make them any good, so I might as well right them on my own from scratch. And it doesn't support python 3.11+, so it's a big issue.
@НиколайРюмин-й6и
@НиколайРюмин-й6и 2 ай бұрын
oh, sorry, that was a hook for further story
@НиколайРюмин-й6и
@НиколайРюмин-й6и 2 ай бұрын
Maybe better practice to read chunks from file is async for?
@MakeDataUseful
@MakeDataUseful 2 ай бұрын
Great video, thanks for sharing
@Shane1994322
@Shane1994322 3 ай бұрын
Clearly explained!! Thank you
@badrakhariunchimeg1031
@badrakhariunchimeg1031 3 ай бұрын
Well fastapi ( fun get ( ))
@PyPeak
@PyPeak 3 ай бұрын
Beautifully explained!
@mattstroker3742
@mattstroker3742 3 ай бұрын
Nice!
@vikranttyagiRN
@vikranttyagiRN 3 ай бұрын
Nice explanation. Concise and to the point.
@oktay9784
@oktay9784 3 ай бұрын
this is not about FastApi, its about sync functions and async functions so just dont use sync functions in async functions if sync one is takes a lot of time.
@MakeDataUseful
@MakeDataUseful 2 ай бұрын
This is a fastAPI video
@805bluebell
@805bluebell 2 ай бұрын
It's actually both. End of argument
@sticksen
@sticksen 3 ай бұрын
My question would be how FastAPI then manages workload when it´s handed over to the worker thread. Because I can only see one worker thread running, at the same time it handles 40 'workloads' concurrently.
@sany2k8
@sany2k8 3 ай бұрын
Great explanation, you should create more videos bro...
@arjunc5896
@arjunc5896 3 ай бұрын
def endpoint3() is not running parallely for me as supposed to what u said in the video. Instead it is sunning one at a time. Do u know why?
@codecollider
@codecollider 3 ай бұрын
I believe you are testing APIs in the browser. Sometimes, browsers like Chrome have limitations on making parallel requests to the same URL. In the video, if you look closely, I am using two different browsers to hit the same API in parallel. You can try the same approach.
@arjunc5896
@arjunc5896 3 ай бұрын
@@codecollider Yes you are right. I tried from different browsers and it worked. Strange though. Thanks
@nitishvirtual4745
@nitishvirtual4745 3 ай бұрын
Great video. Short and to the point. Subscribed.
@ChrisHalden007
@ChrisHalden007 3 ай бұрын
Great video. Thanks
@ahmedelnakeeb5853
@ahmedelnakeeb5853 3 ай бұрын
this should boom i love ur channel
@lwangacaleb2729
@lwangacaleb2729 4 ай бұрын
I need some help, I want to create a fast api endpoint that calls a synchronous function that has a lot of blocking I/0 operations. But I want the endpoint function to run asynchronously so it can accept many requests at the same time. How should I do this, is there an alternative approach?
@Praise-rs4mc
@Praise-rs4mc 3 ай бұрын
The only way to achieve that is to use multi-threading which I advice against.... instead, make the function asynchronous and try to find the non-blocking function for what you want to do...
@Praise-rs4mc
@Praise-rs4mc 3 ай бұрын
Better still, use the run_in_threadpool function from fastapi to run the process in a different thread so that you don't block the event...better than implementing multi threading on your own.
@lwangacaleb2729
@lwangacaleb2729 3 ай бұрын
@@Praise-rs4mc thanks alot, I will give it a try.
@shantanudas6319
@shantanudas6319 4 ай бұрын
Crisp and clear ❤
@ChrisHalden007
@ChrisHalden007 4 ай бұрын
Great video. Thanks
@amodsahabandu
@amodsahabandu 4 ай бұрын
Thanks. ❤
@thanosaur6741
@thanosaur6741 4 ай бұрын
great video
@robertavetisyan8282
@robertavetisyan8282 4 ай бұрын
boooozi txeq
@richardboreiko
@richardboreiko 4 ай бұрын
Why not just return condition?
@codecollider
@codecollider 4 ай бұрын
Using `return condition` directly is more efficient when you only need to return the boolean value itself. However, the purpose of my comparison was to explore different styles of conditional statements and their performance, especially in scenarios where the if-else structure is necessary for more complex logic.
@suen-tech
@suen-tech 4 ай бұрын
Thnx
@user-sh1fv9mm2v
@user-sh1fv9mm2v 4 ай бұрын
I always upload with just an post.
@SAsquirtle
@SAsquirtle 4 ай бұрын
very nice video, thanks!
@udaym4204
@udaym4204 4 ай бұрын
can you make fastapi how run under the hood and how @app.exception_handler work Thanks awesome contentent
@ishaquenizamani9800
@ishaquenizamani9800 4 ай бұрын
Thanks for clearing this concept.
@boringhuman9427
@boringhuman9427 4 ай бұрын
As per LEGB rule , it is considered as enclosed variable - neither local or global but behaves as local and global within a function more specifically under decorators
@MakeDataUseful
@MakeDataUseful 2 ай бұрын
Local, Enclosing, Global, and Built-in scopes for those playing along at home
@user-sh1fv9mm2v
@user-sh1fv9mm2v 4 ай бұрын
Your videos are the best. No bs, just facts.
@MathClubfor6789
@MathClubfor6789 4 ай бұрын
Great knowledgable video
@temirlllan
@temirlllan 4 ай бұрын
thx bro! so useful material, keep going
@myselfriz
@myselfriz 4 ай бұрын
very well explanation.
@cyyan1139
@cyyan1139 4 ай бұрын
thank you!
@pritamsarkar3371
@pritamsarkar3371 4 ай бұрын
dont we have to enable the 68 no line? "app = Fastapi(lifespan=lifespan)" ?
@codecollider
@codecollider 4 ай бұрын
Yes you have to uncomment that line if you are using lifespan, forget to tell in the video.
@seva9375
@seva9375 4 ай бұрын
Hello I am not able to run Pynguin. I tryed your approach and got this error: (base) seva@air-von-seva Pynguin_input % pynguin --project-path . --module-name test_example_2 --output-path . Traceback (most recent call last): File "/Users/seva/anaconda3/bin/pynguin", line 5, in <module> from pynguin.cli import main File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/__init__.py", line 9, in <module> import pynguin.generator as gen File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/generator.py", line 31, in <module> import pynguin.analyses.seeding as seeding # pylint: disable=consider-using-from-import ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/analyses/seeding.py", line 25, in <module> import pynguin.ga.testcasechromosome as tcc File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/ga/testcasechromosome.py", line 13, in <module> import pynguin.ga.chromosome as chrom File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/ga/chromosome.py", line 13, in <module> import pynguin.ga.computations as ff File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/ga/computations.py", line 17, in <module> from pynguin.testcase.execution import ExecutionTrace File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/testcase/execution.py", line 425, in <module> class ExecutionTracer: File "/Users/seva/anaconda3/lib/python3.11/site-packages/pynguin/testcase/execution.py", line 460, in ExecutionTracer Compare.IN: lambda val1, val2: ( ^^^^^^^^^^ File "/Users/seva/anaconda3/lib/python3.11/enum.py", line 784, in __getattr__ raise AttributeError(name) from None AttributeError: IN
@lucaspraciano4640
@lucaspraciano4640 4 ай бұрын