- Official Docs: C Nodes point to the old
erl_connect
interface, which might put someone off writing a C Node (memory management, etc) - Official docs: ei_connect seems to be the preferred way to write C Nodes as of now
erl_connect
will be removed in OTP 23
- There's a pure java implementation of C Nodes: github.com/appulse-projects/encon-java
- Notes
- C Nodes connect as hidden nodes (cannot be seen in
Node.list()
) - there's probably much more to learn: e.g. how to correctly handle certain types of messages sent to the C nodes by OTP
- after some time with
ei_connect
, writin C Nodes doesn't look scary anymore
- C Nodes connect as hidden nodes (cannot be seen in
- now one can e.g. export expensive or specialized computations into external proc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% exercise: https://www.futurelearn.com/courses/concurrent-programming-erlang/3/steps/488334 | |
-module(palindrome_server). | |
-export([server/0, server/1, demo/0, demo_client/2]). | |
-import(timer, [sleep/1]). | |
server({check,Sentence}) -> | |
case (palindrome_check(Sentence)) of | |
true -> {result, Sentence ++ " is a palindrome"}; | |
false -> {result, Sentence ++ " is not a palindrome"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://ideone.com/w49bT4 | |
# https://gist.github.com/d-led/e1b18377bbe2cc5dd92cdb54e2183b1b | |
# inpired by https://andrealeopardi.com/posts/connection-managers-with-gen_statem/ | |
defmodule Counter do | |
@moduledoc """ | |
This is an example gen_statem based Counter. | |
The counter enters an invalid state, when decremented at state 0. | |
To recover from the invalid state, reset it via Counter.reset | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// groovy groovy_vlingo.groovy | |
package github.dled | |
@Grapes([ | |
@Grab("io.vlingo:vlingo-actors:0.7.0"), | |
]) | |
import groovy.transform.CompileStatic | |
import io.vlingo.actors.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# created with sonic pi | |
live_loop :shots do | |
with_fx :reverb, amp: rrand(0.1, 1.5) do | |
with_fx :pan, pan: rrand(-1,1) do | |
sample :bd_haus, rate: 0.5 | |
end | |
end | |
sleep rrand(0.1,0.2) | |
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://ideone.com/fJZczA | |
tasks = | |
for i <- 1..10 do | |
Task.async(fn -> | |
Process.sleep(:rand.uniform(1000)) | |
i | |
end) | |
end | |
Task.yield_many(tasks, 500) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.geepawhill.contentment.flow; | |
import static org.geepawhill.contentment.utility.JfxUtility.color; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.geepawhill.contentment.format.Format; | |
import org.geepawhill.contentment.style.Frames; | |
import org.geepawhill.contentment.style.TypeFace; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.stream.*; | |
import java.util.concurrent.*; | |
public class NoExhaust { | |
public static void main(String []args){ | |
ExecutorService executor = Executors.newFixedThreadPool(8); | |
Runnable ticker = () -> { | |
IntStream.range(1, 150) |
NewerOlder