Gleam + Relm4 foreign node POC over Erlang distribution
0

Configure Feed

Select the types of activity you want to include in your feed.

gleamtk / scripts / smoke_dist.escript
925 B 32 lines
1#!/usr/bin/env escript 2%%! -name smoke@127.0.0.1 -setcookie gleamtk 3-mode(compile). 4 5main([]) -> 6 true = register(controller, self()), 7 io:format("registered controller pid=~p~n", [self()]), 8 case net_adm:ping('ui@127.0.0.1') of 9 pong -> 10 io:format("ping=pong~n"), 11 {gui, 'ui@127.0.0.1'} ! {hello, self()}, 12 {gui, 'ui@127.0.0.1'} ! {set_title, <<"from smoke">>}, 13 {gui, 'ui@127.0.0.1'} ! {set_label, <<"smoke label">>}, 14 {gui, 'ui@127.0.0.1'} ! {set_count, 7}, 15 {gui, 'ui@127.0.0.1'} ! ping, 16 drain(8), 17 halt(0); 18 pang -> 19 io:format("ping=pang~n"), 20 halt(1) 21 end. 22 23drain(0) -> 24 io:format("drain done~n"); 25drain(N) -> 26 receive 27 M -> 28 io:format("got ~p~n", [M]), 29 drain(N - 1) 30 after 2000 -> 31 io:format("drain timeout (~B left)~n", [N]) 32 end.