forked from atomvm/AtomVM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add support for handshake from OTP nodes - Add support for monitoring processes and sending messages to registered processes from OTP nodes Signed-off-by: Paul Guyot <[email protected]>
- Loading branch information
Showing
23 changed files
with
2,165 additions
and
17 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
% | ||
% This file is part of AtomVM. | ||
% | ||
% Copyright 2024 Paul Guyot <[email protected]> | ||
% | ||
% Licensed under the Apache License, Version 2.0 (the "License"); | ||
% you may not use this file except in compliance with the License. | ||
% You may obtain a copy of the License at | ||
% | ||
% http://www.apache.org/licenses/LICENSE-2.0 | ||
% | ||
% Unless required by applicable law or agreed to in writing, software | ||
% distributed under the License is distributed on an "AS IS" BASIS, | ||
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
% See the License for the specific language governing permissions and | ||
% limitations under the License. | ||
% | ||
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | ||
% | ||
|
||
-module(disterl). | ||
|
||
-export([start/0]). | ||
|
||
start() -> | ||
{ok, _KernelPid} = kernel:start(normal, []), | ||
{ok, _NetKernelPid} = net_kernel:start('[email protected]', #{name_domain => longnames}), | ||
io:format("Distribution was started\n"), | ||
io:format("Node is ~p\n", [node()]), | ||
net_kernel:set_cookie(<<"AtomVM">>), | ||
io:format("Cookie is ~s\n", [net_kernel:get_cookie()]), | ||
register(disterl, self()), | ||
io:format( | ||
"This AtomVM node is waiting for 'quit' message, and this process is registered as 'disterl'\n" | ||
), | ||
io:format("On an OTP node with long names distribution, run:\n"), | ||
io:format("erlang:set_cookie('[email protected]', 'AtomVM').\n"), | ||
io:format("{disterl, '[email protected]'} ! quit.\n"), | ||
receive | ||
quit -> ok | ||
end. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
% | ||
% This file is part of AtomVM. | ||
% | ||
% Copyright 2025 Paul Guyot <[email protected]> | ||
% | ||
% Licensed under the Apache License, Version 2.0 (the "License"); | ||
% you may not use this file except in compliance with the License. | ||
% You may obtain a copy of the License at | ||
% | ||
% http://www.apache.org/licenses/LICENSE-2.0 | ||
% | ||
% Unless required by applicable law or agreed to in writing, software | ||
% distributed under the License is distributed on an "AS IS" BASIS, | ||
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
% See the License for the specific language governing permissions and | ||
% limitations under the License. | ||
% | ||
% SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | ||
% | ||
|
||
-module(application). | ||
-export([get_env/3]). | ||
-export_type([start_type/0]). | ||
|
||
-type start_type() :: normal | {takeover, Node :: node()} | {failover, Node :: node()}. | ||
|
||
%%----------------------------------------------------------------------------- | ||
%% @param Application application to get the parameter value of | ||
%% @param Parameter parameter to get the value of | ||
%% @param Default default value if parameter is not found | ||
%% @returns default value | ||
%% @doc Retrieve the value of the configuration parameter `Parameter' for | ||
%% application `Application' or `Default' if not found. | ||
%% @end | ||
%%----------------------------------------------------------------------------- | ||
-spec get_env(Application :: atom(), Parameter :: atom(), Default :: any()) -> any(). | ||
get_env(_Application, _Parameter, Default) -> Default. |
Oops, something went wrong.