up: RPC     index Zimbu documentation

CLASS RPC.Control @public

summary

     

A Control object is passed with an RPC to store its status and be able to cancel it.

It can be extended to pass values from the rpc() call to the done callback.

RPC.State  $state @public  progress of the RPC
status  $status @public  OK while still busy
int  $statusCode @public  the HTTP result code
string  $error @public  filled in when status is FAIL
 
$cancel() @public  Cancel a pending RPC.
$getResponseHeader(name) string @public  When $state is "done" this method can be used to obtain response header entries.
 

members (alphabetically)

     

string $error @public

     

filled in when status is FAIL

RPC.State $state @public

     

progress of the RPC

status $status @public

     

OK while still busy

int $statusCode @public

     

the HTTP result code

for example, status is 200 for a successful request.

Only filled in when $state is "done".

PROC $cancel() @public

     

Cancel a pending RPC.

Will try to cancel if possible.

TODO: not implemented yet

FUNC $getResponseHeader(string name) string @public

     

When $state is "done" this method can be used to obtain response header entries.

Returns NIL when the header is not available.

license

      Copyright 2009 Bram Moolenaar All Rights Reserved.

      Licensed under the Apache License, Version 2.0. See the LICENSE file or obtain a copy at: http://www.apache.org/licenses/LICENSE-2.0