Building the Real-time Web with Python and aiohttp (Steven Seguin)

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

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

  • @japrogramer
    @japrogramer 7 лет назад

    Neat talk, I have built my own async framework and currently working to add django styled routing and making it asgi compliant. Im using the async protocol factories and the h2 python library as a wrapper. I have discovered that i have a lot of reading ahead of me .. i need to better understand the life cycle of the connection thru those protocol factories

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

    18:30
    import socket
    socket = socket.socket(socket, socket.SOCKET_STREAM
    we get it, just put socket EVERYWHERE

  • @Gregory.Pacheco
    @Gregory.Pacheco 6 лет назад

    Where is this presentation?

  • @PulkitKumar191
    @PulkitKumar191 7 лет назад

    Great!

  • @sandeepvk
    @sandeepvk 7 лет назад +2

    Node already does this using callbacks

    • @anton6643
      @anton6643 7 лет назад

      fs.readdir(source, function (err, files) {
      if (err) {
      console.log('Error finding files: ' + err)
      } else {
      files.forEach(function (filename, fileIndex) {
      console.log(filename)
      gm(source + filename).size(function (err, values) {
      if (err) {
      console.log('Error identifying file size: ' + err)
      } else {
      console.log(filename + ' : ' + values)
      aspect = (values.width / values.height)
      widths.forEach(function (width, widthIndex) {
      height = Math.round(width / aspect)
      console.log('resizing ' + filename + 'to ' + height + 'x' + height)
      this.resize(width, height).write(dest + 'w' + width + '_' + filename, function(err) {
      if (err) console.log('Error writing file: ' + err)
      })
      }.bind(this))
      }
      })
      })
      }
      })

    • @hyperboogie
      @hyperboogie 7 лет назад +9

      Sandy The whole point behind aiohttp and the underlying asyncio framework was to avoid the callback hell way of doing things (although it's definitely possible) and adopt the coroutines methodology which is definitely more elegant, readable and in my opinion scales better.
      Another plus is that aiohttp is a python framework and node is JS based and while your choice of programming language is very subjective, it's safe to say that JS is horribly broken and convoluted. there have been many attempts throughout the years to fix it, and to some degree, they were partly successful but you can only do so much... Personally for me, programming with JS always felt like an exercise in workarounds, whereas python always felt natural, elegant, immensely powerful and productive.

    • @sandeepvk
      @sandeepvk 7 лет назад +1

      LOL. I agree. I love Javascript as much as i hate it. I love it because its very easy to adopt and I am struggling to stay in it 'cause its so darn versionised. Actually, its not the fault of Javascript. It was not made for the modern Web which is so modular. So everyone is creating "their" versions of JS. React has JSX. And E6 have reverse compatibility issue with Es5, thus a thousand pre-complier are born and you don't know what is compiling to what. You end up learning flavour of all language to build something. And one top of that there are frameworks and wanna be frameworks. But I can't leave Javascript 'cause i love the web and JS is the king of the web :)