Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out a nice way to structure a small Livebook program #19

Open
fhunleth opened this issue May 7, 2021 · 2 comments
Open

Figure out a nice way to structure a small Livebook program #19

fhunleth opened this issue May 7, 2021 · 2 comments

Comments

@fhunleth
Copy link
Contributor

fhunleth commented May 7, 2021

The idea is it should be possible to write a short program in Elixir that runs indefinitely in Nerves Livebook. For an Arduino, this would be filling in setup() and loop() functions. I am not sure how this best maps to Elixir, but I think that it would be pretty neat.

If anyone has ideas, feel free to add to this issue or link to a proof-of-concept.

@PhillippOhlandt
Copy link

Maybe add an empty DynamicSupervisor to the main supervision tree. Since in Nerves Livebook, everything is one instance, it would be really easy to write some code (supervisor, genserver, etc.) in a livebook and start that under the dynamic supervisor, where it then keeps running until a restart or manual stop.

@a-maze-d
Copy link

I love the idea. You might want to get more fancy than that and allow it to survive a restart.

Maybe register a (or several) livebook(s) that gets executed after startup. This would be very powerful especially in combination with the above mentioned DynamicSupervisor.

Only thing to think about would be on how to have a way to avoid the automatic startup (for the case that there is some nasty bug in the application). Otherwise the user might end up in an endless loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants