Encapsulates the methods exposed by the BFS system.
openBrl(brl: string): PromiseLike<BFS.Channel.Port | undefined>
Parameter Description
Return Value: Port used for duplex communication between two applications
import "@bfs/bfchain-runtime-typings";
const bfs = bfsprocess.import("bfs");
(async ()=>{
// Open an application and get a port for duplex communication between two applications
const duplexPort = await bfs.openBrl("test://home.org");
})()
importService(mime: string, serviceName: string)
Description: Import bfs system service
Parameter Description:
const testLoader = bfs.importService("borker", "testService");
(async ()=>{
const test = await testLoader;
const block = test.getBlock();
})()
namespace BFS {
namespace Channel {
interface Port<I = unknown, O = unknown> {
send(msg: O, transfer?: any): void;
close(): void;
onRec: BFS.Evt.AttachOnlyEvtBase<I>;
onRecError: BFS.Evt.AttachOnlyEvtBase<unknown>;
onClosed: BFS.Evt.StatefulEvt.AttachOnlyEvtBase<boolean>;
}
}
}