Asynchronous Tasks in Python - Getting Started With Celery

Поделиться
HTML-код
  • Опубликовано: 23 ноя 2024

Комментарии • 95

  • @chikwang241
    @chikwang241 4 года назад +78

    "Straightforward" is what the world needs. Thank you.

  • @REBUTTELER
    @REBUTTELER 2 года назад +7

    This is a beautiful tutorial. I've bought a Udemy course specifically for Celery and read multiple pieces of documentation and they were laced with needless information. This summarizes the bare essentials that I really needed to know. Thank you!

  • @stephanschlogl8592
    @stephanschlogl8592 4 года назад +14

    Thanks for this video. As always very helpful. An in depth example using celery within django or flask and also covering how to configure different workers and queues for various tasks would be great!

  • @gopesh97
    @gopesh97 Год назад +1

    Finally a celery video that makes so much sense!! Thank you!!

  • @TechWithSabri
    @TechWithSabri 2 года назад

    thank you so much for your time and it still works in 2022,
    for beginners i advice you to go with documentation of Celery and then check these videos

  • @salimkachemela
    @salimkachemela 4 года назад +41

    Great explanation. It would of much awesome if you could explain it with a more concrete example with, say may be a django project, may be sending and receiving data to/from an external API. That's the part that trips people a lot.

    • @ConsuelaPlaysRS
      @ConsuelaPlaysRS 3 года назад +2

      +1 to this. Would also like some explanation about when to use a dedicated MQ vs database and why/how this is different from threading.

  • @rudeadyet1992
    @rudeadyet1992 4 года назад +5

    Thanks, Anthony. Also would like to know more about Chaining, Grouping and Chording of the tasks in Celery.

  • @Jacques_3d
    @Jacques_3d 16 дней назад

    Great video. thanks for the clear cut example

  • @JFromAcc
    @JFromAcc 3 года назад +1

    Phenomenal video. Got me up and going when I was stuck.

  • @yan200go
    @yan200go 2 года назад

    The best video about celery

  • @ChrisHalden007
    @ChrisHalden007 4 года назад +5

    That was quite a timing. Needed an overview of Celery right now ;) Great video. Thanks!

  • @q44444q
    @q44444q 4 года назад +3

    Excellent overview, thank you! Would be awesome if you added a video about how to communicate progress for longer running tasks.

  • @SaiGollapudi
    @SaiGollapudi 8 месяцев назад

    Wow. simple and clear. Thanks for making and sharing the video

  • @PrickyToTheMoon
    @PrickyToTheMoon Год назад

    Thank you for this video. Exactly what I was looking for.

  • @vitorsilva-or1dj
    @vitorsilva-or1dj 6 месяцев назад

    I LOVE YOU BRO!!!!! THANKS, BRAZIL HERE

  • @ejay4032
    @ejay4032 Год назад

    Awesome, straight forward video.

  • @StudyStreamPlus
    @StudyStreamPlus 9 месяцев назад

    Thanks for this. Solid introduction.

  • @ericsalesdeandrade9420
    @ericsalesdeandrade9420 Год назад

    Really nice video and top quality. Thanks.
    What screen recording software do you use? Is this on a 4K monitor?

  • @bashirabdelwahed40
    @bashirabdelwahed40 2 года назад

    straight to the point! I love this video

  • @Haririsina
    @Haririsina 2 года назад

    thank you for smooth explanaition.

  • @OboriNN
    @OboriNN Год назад

    Thank you!
    Easy, clear, fast.

  • @DaniloSilva-pl3sq
    @DaniloSilva-pl3sq 2 года назад

    SUCH A GOOD EXPLANATION!!!!!!

  • @CesarContreras13
    @CesarContreras13 4 года назад +2

    if I would want to send an email one week after some user do something, for instance, should I use Celery?
    great video btw

  • @noobsperspective1610
    @noobsperspective1610 24 дня назад

    Very clear! Thank you!

  • @jetra_h
    @jetra_h 4 года назад +3

    your videos are good, but as newbies, we can't follow. if you could include how to set up rabbitmqp as well. And if your video is about scheduling sending post or email. would be great!

  • @medley5670
    @medley5670 4 дня назад

    When using sqs as a broker for celery. What could be the reason for getting “Received and deleted unknown message. Wrong Destination?”

  • @AshikG
    @AshikG Год назад

    great and simple explanation.

  • @TheAremoh
    @TheAremoh Год назад +1

    Nice introduction.
    What's the difference between send_task and delay method?

  • @SviatoslavKalina
    @SviatoslavKalina 2 года назад

    Thank you for good explanation.

  • @gaby1491
    @gaby1491 4 года назад

    this was clear and to the point. thank you!

  • @kilbeam99
    @kilbeam99 4 года назад +1

    I have a website running on Flask that calculates travel times between appointments in Google Calendar. The calculation of these travel times can take up to 1 minute, so I want to push it to the background with celery. Your video has really helped me grasped the basics, but I have a few questions.
    The process won't return anything, other than say "it's done". In other words, when a user starts the calculation, I want them to be redirected to a "waiting" page, and be redirected again to a "success" page when it is done.
    How can I have Flask redirect a user from the waiting page to the success page as soon as the process is done? Do I need to have Flash check the status of the process every few seconds?

    • @kvedia15
      @kvedia15 3 года назад +1

      you can have use setInterval in javascript and send a request to you backend every minute to check the status of the celery worker, if its done you can redirect the user to the results page?

  • @adityanjsg99
    @adityanjsg99 Год назад +1

    20 hrs of work condensed in to 10 mins of video

  • @entity5678
    @entity5678 Год назад

    very helpful video..thank you sir

  • @maikhanhchi4479
    @maikhanhchi4479 2 года назад

    so touching for an excellent video

  • @MrGarg10may
    @MrGarg10may 3 года назад

    Very nice explanation

  • @Ekosusiloharjo
    @Ekosusiloharjo 4 года назад

    Thank you Anthony, can you make tutorial for howto manage queuing in post message

  • @ksradau
    @ksradau 10 месяцев назад

    perfect explanation! thanks a lot

  • @SP-db6sh
    @SP-db6sh 2 года назад

    Remember this channel as Wiki-Tube !

  • @Ahmed-hv9bt
    @Ahmed-hv9bt 3 года назад

    So basically when we call .delay method on any task, celery throws that task into the task queue from where celery worker fetches the tasks to execute. In this example, queue was at cloud. If Internet stops working(for the sake of example) after calling the .delay method on task, celery worker won't be able to fetch the task and execute the task. Correct?

  • @rishabh.malviya
    @rishabh.malviya Год назад

    This was awesome!

  • @cassiosalvador7961
    @cassiosalvador7961 4 года назад

    Thanks for this video, it helped me a lot!

  • @jpgarcia90
    @jpgarcia90 3 года назад

    Hi Anthony, thanks for the video. Would you still recommend to use Celery or go for Flask 2.0 async capabilities?

  • @marcelogrsp
    @marcelogrsp 3 года назад +1

    Confusing method name “delay”! It could be “enqueue” or am I getting the wrong concept of delay method?

  • @mystackquest
    @mystackquest 3 года назад

    Hai Anthony... Your videos are helpful for me. But I am stucked on Flask factory pattern since Celery don't have init_app method. It makes import issues. How can I solve this issue? Thanks in advance.

  • @zhenhuanSupport
    @zhenhuanSupport 3 года назад

    This is great if u can use flower together it will be more presentable

  • @harshitsantosh825
    @harshitsantosh825 4 года назад +5

    A great video. It would have been better of you could shown where we can use it. The example was really straightforward.

  • @cynthia7000
    @cynthia7000 2 года назад

    Great video! One question - I always hear these terms in System Design -- put the task/job in the queue and execute later, so is it a string/function/or other things that we put in the queue?? Thanks!!👍👍👍👍👍

  • @lfnkf
    @lfnkf 4 года назад +1

    Just got my sub. Thanks for sharing it!

  • @Firiyuu
    @Firiyuu 4 года назад +1

    Hwo did you make celery work on windows?

  • @jeffz7310
    @jeffz7310 Год назад

    Beautiful printed

  • @akshatagrawal819
    @akshatagrawal819 3 года назад

    Amazing tutorial!

  • @TheWellington1997
    @TheWellington1997 2 года назад

    hello! Can you explain how to prioritize tasks with redis backend?

  • @danswaney4134
    @danswaney4134 8 месяцев назад

    How do you push status_update() to take effect before returning?

  • @calvinnicxon
    @calvinnicxon 4 года назад

    This is great mate!
    I wonder how can we run the worker in the background. I've read that some documentation to run the worker as a daemon. But I still don't understand it fully.

  • @WaldoTheWombat
    @WaldoTheWombat 3 года назад

    Ok thanks, but when i do it in a python file then the print statement doesn't execute until the the the reverse function is finished (not happening asynchronously):
    from tasks import reverse
    reverse.delay("anthony")
    print("something")

  • @shatandv
    @shatandv 3 года назад

    Nice and clear, thanks!

  • @dheerajthodupunoori7431
    @dheerajthodupunoori7431 3 года назад

    i want to create a celery task , and inside that task i am creating two processes using multiprocessing module in python .
    Will that work fine?

  • @EnglishRain
    @EnglishRain 3 года назад

    Thank you this was excellent!!

  • @storiesshubham4145
    @storiesshubham4145 Год назад

    Amazing Amazing Amazing 🎉

  • @SkimFelBon
    @SkimFelBon 4 года назад

    great video, very helpful

  • @now1313
    @now1313 3 года назад

    Thank you for the tutorial. We are testing apps which use celery and now I’m actually starting to get what was going on :(

  • @Furyki
    @Furyki 3 года назад

    Hi @Pretty Printed, can u create a tutorial how to use Redis Version 6 with Celery in python ? , tnx in advance.

  • @pascholatti
    @pascholatti Год назад

    Great, that really helped

  • @iqbalhonnur4451
    @iqbalhonnur4451 4 года назад

    Why can't we use rabbitmq itself as a task queue and also as mb instead of celery?

  • @praveeniyer4294
    @praveeniyer4294 2 года назад

    I have a requirement, to develop a celery based scheduling service which dynamically call a url for every 5 minute / 15 minutes/ 1 hour

  • @gautamrishi5391
    @gautamrishi5391 2 года назад

    does celery.delay() takes time. if it does how to minimize that?

  • @Furyki
    @Furyki 4 года назад

    Hi @Pretty Printed , can u create a tutorial how to use celery on django? , tnx in advance!!

  • @GregWoodsLancs
    @GregWoodsLancs 4 года назад

    @1:01 when not using Heroku, where do I get the AMQP URL? Looking in the RabbitMq Web Management interface, I can't see any trace of it

    • @rutujpande4816
      @rutujpande4816 3 года назад

      @@GregWoodsLancs can you please share your source docs. would be helpful.

  • @deepamgupta8011
    @deepamgupta8011 3 года назад

    Pretty Explained

  • @codedjango
    @codedjango 4 года назад

    Thank you Anthony

  • @KrishnaManohar8021
    @KrishnaManohar8021 4 года назад

    continue this series...

  • @danielschmider5069
    @danielschmider5069 4 года назад +2

    you didnt actually run multiple asynchronous tasks tho, kinda missing the point this way... How does this compare to just using asyncio, which is built-in into python, doesnt require a broker, or redis and sqlite dbs and sqlalchemy?

    • @rblr46
      @rblr46 4 года назад +4

      Asyncio uses green threads/coroutine for concurrency, using only one thread hence once CPU. Asyncio is for I/O bounds process, that includes a lot of waiting. If we have a lot of CPU bound task that we want to do asynchronously on different processes, we can send them for a celery worker to process. Be careful not being confused with concurrency (asyncio)/parallelism (celery)

  • @Johnbin89
    @Johnbin89 4 года назад

    Can you use it on a function that takes a form object as an input? My guess is a no as i had big trouble in a django project using Django_Q, but has anyone done it with celery?

  • @ganeshdabral8963
    @ganeshdabral8963 3 года назад

    thanks it's very helpfull

  • @rogueriver
    @rogueriver 3 года назад

    What is the difference between celery and asyncio?

  • @Anshegar
    @Anshegar 3 года назад

    then i try to use DB , celery not writing in db , but no errors.

  • @CrashLaker
    @CrashLaker 4 года назад

    great thank you

  • @IllevensKO
    @IllevensKO 2 года назад

    You're saying that "celery needs task queue" but the description of celery says it IS a task queue itself. I usually love all your tutorials, but this moment was very confusing.

  • @mingli9563
    @mingli9563 3 года назад

    Awesome

  • @bennguyen1313
    @bennguyen1313 4 года назад

    As a beginner, I like all the quick tips you casually mention.. like reversing a string using text[::-1], or the use of Heroku to run python in the cloud, or sqlite3 / sqlalchemy for the database! Not sure about the decorator part, but I like how you can use import your custom function using "from tasks import reverse"
    How does Celery differ from import threading / TaskThread() ?
    How does RabbitMQ / Redis task queues, differ from python's queue?
    Seems alot of people use Celery with Django for web applications.. like web scraping instead of using curl?

  • @praveeniyer4294
    @praveeniyer4294 2 года назад

    Can you please help me

  • @onesky4343
    @onesky4343 3 года назад

    Thanks ynohtnA

  • @yuhechen7258
    @yuhechen7258 4 года назад

    like a breeze

  • @jafarOTS
    @jafarOTS 3 года назад

    hi, I use celery with redis on my local machine but anytime I try to run the celery worker i get the error [2021-04-21 11:09:52,283: ERROR/MainProcess] consumer: Cannot connect to redis://localhost:6379//: Error 10061 connecting to localhost:6379. No connection could be made because the target machine actively refused it, how do i resolve it please?

    • @DenzelHooke
      @DenzelHooke 3 года назад

      Change your port. Sometimes the default localhost ports aren't available and you have to go higher. 8080 usually works.

  • @myevar84
    @myevar84 2 месяца назад

    Thanks a lot. I am trying this example on Window but I'm getting tesk received, not secceed "[2024-09-10 12:26:24,835: INFO/MainProcess] Task tasks.reverse[c662f373-1f2d-434d-bf27-0019e3795b20] received". I tried "celery -A tasks worker --loglevel=DEBUG --without-gossip", but nothing changed !! Maybe can someone help me.