Simple task queues with Flask & Redis - An introduction - Learning Flask Series Pt. 21

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

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

  • @la_da_kid
    @la_da_kid 5 лет назад +3

    Solid tutorial bro, way better than some of the ones I found online that overcomplicated the hell out of this

  • @lewismenelaws2344
    @lewismenelaws2344 5 лет назад

    Amazing video. Got right to the point, easily described what Redis and Queue Manager does and a great demonstration. This video deserves more views. Cheers Julian.

  • @lazypunk794
    @lazypunk794 5 лет назад +19

    If anyone else got this error like me :
    "ValueError: Functions from the __main__ module cannot be processed by workers"
    try and put your "background_task()" in a different file and import it here from that module. Works.

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

      Thankyou man

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

      why is that happen?

    • @tahep3906
      @tahep3906 2 года назад +1

      This is the solution, thanks for sharing with us

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

    I'm trying to follow your tutorial, but I got ValueError: Functions from the __main__ module cannot be processed by workers when enqueue the backgroup_task..... why are you able to run the function that's defined inside of your main script ?

  • @dano2169
    @dano2169 5 лет назад +5

    How is it that you only have 700 subs? This content was excellent, will promote.

    • @ServetEdu
      @ServetEdu 5 лет назад

      Total goldmine, but he has gained 260 subscribers in the last 30 days, so things are looking good!

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

    Thanks, this is very consise and clean, good one, I was also searching for same kind of tutorial with celery and django.

  • @LockStockNBarrel
    @LockStockNBarrel 5 лет назад +3

    How do you get and do something with the return of the queued task? Say your queued task returns a number you want to then display on the client after its been processed. In your example the return len(q)

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

      I was wondering the same thing. Did you find info on this?

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

      python-rq.org/docs/results/ useful info that addresses this

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

    Thx for this video. Very helpful. How would retrieve the value of (n) which is return by the background task once this finished to be executed by the redis worker?

  • @gopalkisi8665
    @gopalkisi8665 3 года назад +3

    ValueError: Functions from the __main__ module cannot be processed by workers.

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

    i have function and i want that to be executed as background task , but that function internally creates two processes using multiprocessing module
    will that work fine ?
    could you please help me with this

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

    noice !, no BS no lengthy explanation on stuff that i dont need, just have to ignore the windows10 and the vscode but cant have it all, Subbed !

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

    Hi julian. Thanks for the video. Wanted to ask you if you are going to make a video about thread synchronization and sending the output back to the web client. Thanks.

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

    hi i got this error on the worker ....
    UnpickleError: (u'Could not unpickle', ValueError('unsupported pickle protocol: 4',))
    does anyone have any idea?

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

      I have the same, still struggling what to do with it. Did you find any solution?

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

    I am a bit confused on this point, if this is in a production environment...if a user placed a job on the que would it immediately run if they dont have jobs on the que or would if wait for lets say another logged in users job to finish on the que?

  • @raihanflores
    @raihanflores 5 лет назад

    Starting a project using Python + RQ.. this helps big time. Thanks!

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

    Nice Tutorial and thank you. How would you proceed if you do not know how long a task will take to execute. And how would you store them in a DB to be executed one by one and in serial?

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

    link does not work. 403. for all routes. {
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {

    },
    "status": "Failure",
    "message": "forbidden: User \"system:anonymous\" cannot get path \"/\"",
    "reason": "Forbidden",
    "details": {

    },
    "code": 403
    }

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

    Why not factory? It's Pt 21, not Pt 2, right?

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

    Hey does any one have a git repo of this? Getting an error TypeError: hset() got an unexpected keyword argument 'mapping'

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

    Heu @JulianNash #JulianNash I followed your tutorial and then tried to transfer it into my larger project and I get an important error for my root project name... Whats with that?

  • @rayanfernandes2631
    @rayanfernandes2631 5 лет назад +1

    Subscribed right away ... you took away my headache :)

  • @sergeyshevtsov5125
    @sergeyshevtsov5125 5 лет назад

    Nice example. Good for start. Thanx Julian!

  • @csvjcsvj3325
    @csvjcsvj3325 5 лет назад +1

    Thanks, that was most helpful and at the the right pace!

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

    Big ups my guy. You're a life saver

  • @tejasarlimatti8420
    @tejasarlimatti8420 5 лет назад

    Hi how can you spawn multiple rq workers to increase performance ?

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

    Hi Julian, Thanks for a great video, I really enjoy your videos. I am having an issue where q_len is never updating (when I print q_len in the terminal, it continues to show 0 even when I refresh). Could you (or one of the great community) provide some guidance as to what is causing this? Many thanks in advance.

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

    providing links to the code files in your patreon, if you're not already doing it, might incentivize more people to support you.

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

    Very nice and clean explanation. Subscribed!

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

    child_pid = os.fork()
    AttributeError: module 'os' has no attribute 'fork'

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

      I'm experiencing the same thing. Have you found a workaround?

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

      @@jeremydeceuster6912 you need WSL

  • @Superdooperhero
    @Superdooperhero 5 лет назад

    How are you running Redis on Windows? Which version?

    • @mattgregory9775
      @mattgregory9775 5 лет назад +1

      I was confused about this for a while as well. Julian looks to be using Windows Subsystem for Linux (WSL) and you can develop everything on the Linux side in a virtual environment that you set up there. You can access your C: drive through '/mnt/c'. If you look at Julian's terminal, you can see that's how he did it.

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

    What about music? The music is very disturbing, no words are heard.=(
    The topic is very interesting and important

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

    are you from poland street mate?

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

    Thank you sooo much, it's very helpful and informative.

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

    Thank you very much! Great tutorial!

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

    Thank you.

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

    Thank you! This helps big time!

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

    10:03 made me believe something's wrong with my earphones

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

    Thanks

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

    Lit tutorial !

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

    I admire you

  • @Marwin3st
    @Marwin3st 5 лет назад

    thx!

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

    If anyone looking for sample project [python+redis+docker with rq-dashboard for monitoring] - github.com/anandjoshi91/thumbnailed

  • @lonnybulldozer8426
    @lonnybulldozer8426 5 лет назад +3

    What's with the terrible beat playing in the background? It's pretty distracting, bro. Sick backwards hat, though bro. That shows me you're a pretty cool guy, and the sick tattoos also show me that. Awesome. I bet you hang out with a lot of babes, huh? They probably just laugh at you, though, huh? Keep it real, Juilos. Keep it real.