GithubHelp home page GithubHelp logo

Comments (5)

sskorokhodov avatar sskorokhodov commented on August 23, 2024

I think some statements (like requiring core.match) are omitted on the slides for the sake of brevity.

I'm checking the problem with exception now.

from otplike.

pwhittin avatar pwhittin commented on August 23, 2024

Do you know of an Erlang example that is fairly complex, but not very complex, that I can "port" to otplike? I need to understand how to use otplike for my current project, and starting with a well understood Erlang example might be a good approach. Of course, I would contribute the port to the otplike project when I get it working.

I'd probably need to ask you questions along the way. Is creating issues the way you would like me to ask questions?

from otplike.

sskorokhodov avatar sskorokhodov commented on August 23, 2024

Is creating issues the way you would like me to ask questions?

Yes, it would be very nice of you! It also makes it easier for others to find answers to the questions that have already been asked.

from otplike.

sskorokhodov avatar sskorokhodov commented on August 23, 2024

The problem with the example is here:

(gs/start-ns [])

gen-server can only be started by another process. It must be added to the docstring of gen-server/start. The reason why gen-server must be started by another process is that according to OTP principles gen-server must treat exit message from the parent process in a special way.

Exception with the reason "noproc" means that caller is supposed to be a process.

The problem can be fixed by wrapping the last let statement into a spawned function like this:

(process/spawn
  (process/proc-fn []
    (let [[_ server] (gs/start-ns [])]
      (println "2 + 3 = " (add server 2 3)))))

We'll think about fixing this slide.

from otplike.

sskorokhodov avatar sskorokhodov commented on August 23, 2024

Do you know of an Erlang example that is fairly complex, but not very complex, that I can "port" to otplike?

I think of examples from the learnyousomeerlang book. Every chapter has one or more good examples supplementing explanation of a concept. I would started from examples given in this chapter. The book is also useful because it guides you step by step through the OTP principles.

from otplike.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.