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

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024
  • What's the real-time web? Can I build it myself? In Python? Of course you can! This talk will help Python web developers learn how to integrate real-time components with their existing web applications using asyncio and aiohttp.
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 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 :)