Introduction to Elixir - Concurrency Primitives, Processes, and Message Passing - Part Eight

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ธ.ค. 2024

ความคิดเห็น • 19

  • @jollyjerr
    @jollyjerr 3 ปีที่แล้ว +3

    This was really great! Super clear and well taught

  • @alittleextra2832
    @alittleextra2832 2 ปีที่แล้ว +2

    Thank you... this is the best foundation to build upon.

    • @TensorProgramming
      @TensorProgramming  2 ปีที่แล้ว

      Thanks, glad you found it useful. I hope to add more.

  • @josefu-san
    @josefu-san 3 ปีที่แล้ว +1

    Thanks a lot for this Tensor!

  • @combinedcognitions1905
    @combinedcognitions1905 3 ปีที่แล้ว

    best elixir tut

  • @shadow16810
    @shadow16810 3 ปีที่แล้ว +2

    Hey Tensor what is that VSCode theme you use with the beautiful symbols for |>,

    • @TensorProgramming
      @TensorProgramming  3 ปีที่แล้ว +1

      The theme is Spacemacs Dark and the Code ligatures come from a free font called Fira Code which you can download: github.com/tonsky/FiraCode. You will need to enable code ligatures in the settings to the the symbols though.

  • @juan768
    @juan768 5 ปีที่แล้ว +2

    Beautiful voice!

  • @Rishabh0501
    @Rishabh0501 3 หลายเดือนก่อน

    Thanks for this video. It's a great learning experience. I have question about the size of the process. Size of the process will change based on the amount of processing, right? Or it will be around 2kb irrespective of the required processing.

    • @TensorProgramming
      @TensorProgramming  3 หลายเดือนก่อน

      Each of the processes on the BEAM starts at 2kb and then increases from there based on the data structures that you assign to their heap. They can get pretty large depending on how stateful they are.
      Fortunately, you have per process garbage collection which you can invoke manually if you really need to. That being said, I've only really had to do this on one app that was pulling millions of timeseries entries from an influxdb.
      Eventually, I ended up using a process pool for this task and just dumped the process after it was finished instead of using the GC directly. This is also an effective way to keep the processes low in cost; killing them and passing the state off to a new one after minimizing its size. Its almost always useful to treat your elixir/erlang processes as disposable.
      You can see the process size using the observer and the IEX repl.

    • @Rishabh0501
      @Rishabh0501 3 หลายเดือนก่อน

      @@TensorProgramming Thanks a lot Tensor for such a great explanation!

    • @TensorProgramming
      @TensorProgramming  3 หลายเดือนก่อน

      @@Rishabh0501 Not a problem. As an amendment to said explanation, each process has its own isolated heap. I kind of implied as much but thats how they can start at 2kb.

  • @mack_akdas
    @mack_akdas 2 ปีที่แล้ว

    Awesome

  • @alexa8522
    @alexa8522 2 ปีที่แล้ว

    Is this similar to actor model receiving messages?

    • @TensorProgramming
      @TensorProgramming  2 ปีที่แล้ว +3

      Its not similar because the BEAM is the original actor model after all. Every time you hear the term process in this video, you can replace it with actor and it would be roughly the same idea. The Elixir language uses processes/actors for everything.

  • @alivape
    @alivape 4 ปีที่แล้ว +5

    The Morgan Freeman of programming

    • @TensorProgramming
      @TensorProgramming  4 ปีที่แล้ว

      Not entirely sure what that means haha.

    • @anshchaturvedi4235
      @anshchaturvedi4235 2 ปีที่แล้ว

      @@TensorProgramming I think he's talking about your voice, absolutely lovely! And great video, thanks for this!