Это видео недоступно.
Сожалеем об этом.

Long Polling in NodeJS

Поделиться
HTML-код
  • Опубликовано: 20 июл 2020
  • 📘New Course: Build full-stack React Typescript applications tsreact.maksim...
    Long polling in nodejs using the request / response stream objects.
    Code: github.com/sat...
    Where to find me:
    Twitter: / satansdeer
    Discord: / discord

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

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

    Great explanation, simple and clear

  • @saptarshidey13
    @saptarshidey13 3 года назад +15

    Why not use setInterval instead of calling setTimeout recursively?

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

      setInterval will send a request every set period of time irrespective of the previous request's response. This will create a backlog of requests and an unnecessary amount of complexity in handling the data.

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

      @@mdhuzaifa Nice question and a good answer ❤

    • @TheHarsh2318
      @TheHarsh2318 Год назад +2

      Using setInterval we basically implement short polling

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

      @@mdhuzaifa Irrespective of the previous request's response? Not even if you clearInterval before setting the next one?

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

    Please make some videos on MERN stack... Love your teaching❤️

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

    Basically don't use methods that implicitly or explicitly end the response object.

  • @tech.craftsman
    @tech.craftsman 2 года назад

    Subscribed

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

    why setTimeout was calling recursively…¿

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

    How do you get the autocomplete on the command line? I need that 🙂

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

      It's an awesome tool called ZSH. It replaces your regular bash shell

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

      @@FlorianEagox I hope you mean ZSH + OMZ. If want battery-packed, try Fish.

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

    How he able to assign connections=[ ] even after declaring it as const.

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

      If it was a typescript or any linter enabled it would have thrown an error immediately but since JavaScript is an interpreted language it will only throw the error when it runs and goes to that line. The video did not last long to see it though.

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

      @@kalekber so It means that the code never reached that condition till the runtime of this video right?

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

      @@chellathurais650 right, if you pay attention to the if statement, when the tick variable will go over 20 it will hit the logic inside and throw the error

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

    Why are you do all content on English? How many people from (Russia/Ukraine and etc) keep watching you? Have you thought to keep making your content, but on your native language?

    • @divyanshujuneja1291
      @divyanshujuneja1291 2 года назад +6

      Why not make this comment in your native language too? RUclips is platform for world, not just Russia and Ukraine. Let's not forget that RUclips is a company from a country whose native language is English.