Spawn远程进程w / o通用文件系统 [英] Spawn remote process w/o common file system

查看:157
本文介绍了Spawn远程进程w / o通用文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(nodeA@foo.hyd.com)8> spawn(nodeA@bar.del.com, tut, test, [hello, 5]).

我想在bar.del.com上生成一个没有文件系统访问foo的进程。 hyd.com(从我产生的过程),运行模块tut的子程序test。

I want to spawn a process on bar.del.com which has no file system access to foo.hyd.com (from where I am spawning the process), running subroutine "test" of module "tut".

有没有办法这样做,w / o提供nodeA@bar.del.com与编译的tut模块文件?

Is there a way to do so, w/o providing the nodeA@bar.del.com with the compiled "tut" module file?

推荐答案

您可以使用以下功能在远程节点加载模块,而不提供文件本身:

You can use the following function to load a module at remote node without providing the file itself:

load_module(Node, Module) ->
    {_Module, Bin, Filename} = code:get_object_code(Module), 
    rpc:call(Node, code, load_binary, [Module, Filename, Bin]).

代码所示:load_binary / 3 文件名参数仅用于跟踪模块的路径,并且其指向的文件不被本地node_server使用。

As noted in code:load_binary/3 Filename argument is used only to track the path to module and the file it points to is not used by local node_server.

这篇关于Spawn远程进程w / o通用文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆