Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API - create generic ZeroNet API cmd wrapper #299

Open
jaros1 opened this issue Jan 8, 2018 · 0 comments
Open

API - create generic ZeroNet API cmd wrapper #299

jaros1 opened this issue Jan 8, 2018 · 0 comments

Comments

@jaros1
Copy link
Owner

jaros1 commented Jan 8, 2018

A problem is hanging ZeroNet API calls. For example error from UI server, stopped/started UI server and other problems. Callback function must always be executed to prevent hanging operations.

There has been created special ZeroNet API wrappers with hanging cmd detection for some commands (z_site_publish, z_file_get, z_file_write, z_site_info). But big work to create wrappers for all ZeroNet API commands.

One other solution could be merging z_api_operation_start, ZeroFrame.cmd and debug_z_api_operation_end into one function z_debug_api_operation call to ensure that cb in ZeroFrame.cmd request is always called. Timeout after x ms. Different timeout for each ZeroFrame cmd.

    // combine debug_z_api_operation_start, ZeroFrame.cmd & debug_z_api_operation_end into one function call
    // see https://github.com/jaros1/Money-Network/issues/296#issuecomment-355840053
    // params:
    // - pgm: calling pgm
    // - alias: alias for cmd. normally null or blank. used for qbQuery alias
    // - cmd: ZeroFrame cmd
    // - params: arguments to ZeroFrame cmd
    // - debug_this: null, true or false. debug option only for this call
    // - group_debug_seq: bundle sequence of connected ZeroFrame calls. For example send_message or process_incoming_message
    // - cb: optional cb. not used in all ZeroFrame API calls
    // forced timeout after x ms. x different for each ZeroFrame cmd
    function debug_z_api_operation (pgm, alias, cmd, params, debug_this, group_debug_seq, cb) {
        var inner_path ;
        if (alias) inner_path = alias ;
        else {
            // cmd with inner_path.
        }


    } // debug_z_api_operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant