lightningdevkit
Version:
Lightning Development Kit
42 lines • 1.44 kB
JavaScript
import { CommonBase } from './CommonBase.mjs';
import * as bindings from '../bindings.mjs';
class LDKProcessMessagesCallbackHolder {
constructor() {
this.held = null;
}
}
/**
* A callback which will be called to trigger network message processing.
*
* Usually, this should call [`PeerManager::process_events`].
*
* [`PeerManager::process_events`]: lightning::ln::peer_handler::PeerManager::process_events
*/
export class ProcessMessagesCallback extends CommonBase {
/* @internal */
constructor(_dummy, ptr) {
super(ptr, bindings.ProcessMessagesCallback_free);
this.bindings_instance = null;
}
/** Creates a new instance of ProcessMessagesCallback from a given implementation */
static new_impl(arg) {
const impl_holder = new LDKProcessMessagesCallbackHolder();
let structImplementation = {
call() {
arg.call();
},
};
const ptr_idx = bindings.LDKProcessMessagesCallback_new(structImplementation);
impl_holder.held = new ProcessMessagesCallback(null, ptr_idx[0]);
impl_holder.held.instance_idx = ptr_idx[1];
impl_holder.held.bindings_instance = structImplementation;
return impl_holder.held;
}
/**
* The method which is called.
*/
call() {
bindings.ProcessMessagesCallback_call(this.ptr);
}
}
//# sourceMappingURL=ProcessMessagesCallback.mjs.map