Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
fc3423bf
Commit
fc3423bf
authored
Jul 7, 2013
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Remote: Added some more documentation.
parent
0b573563
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/modules/Remote.pmod/Client.pike
+3
-0
3 additions, 0 deletions
lib/modules/Remote.pmod/Client.pike
lib/modules/Remote.pmod/Server.pike
+2
-0
2 additions, 0 deletions
lib/modules/Remote.pmod/Server.pike
lib/modules/Remote.pmod/module.pmod
+42
-1
42 additions, 1 deletion
lib/modules/Remote.pmod/module.pmod
with
47 additions
and
1 deletion
lib/modules/Remote.pmod/Client.pike
+
3
−
0
View file @
fc3423bf
...
...
@@ -2,6 +2,8 @@
#include "remote.h"
import ".";
//! Remote RPC Client.
int connected = 0;
//! @decl Remote.Connection con
...
...
@@ -11,6 +13,7 @@ object con;
function close_callback = 0;
//! Get a named object from the remote server.
object get(string name)
{
if(!connected)
...
...
This diff is collapsed.
Click to expand it.
lib/modules/Remote.pmod/Server.pike
+
2
−
0
View file @
fc3423bf
...
...
@@ -2,6 +2,8 @@
#include "remote.h"
import ".";
//! Remote RPC server.
int portno;
//! @decl Stdio.Port port
...
...
This diff is collapsed.
Click to expand it.
lib/modules/Remote.pmod/module.pmod
+
42
−
1
View file @
fc3423bf
#pike __REAL_VERSION__
#include "remote.h"
//! Remote RPC system.
//! Wrapper for a remote function.
class Call {
constant is_remote_call = 1;
...
...
@@ -11,7 +13,19 @@ class Call {
object ctx;
int _async;
//! Call the wrapped function.
//!
//! @param args
//! Arguments to pass to the wrapped function.
//!
//! This function can operate in two modes depending
//! on whether asynchronous mode has been activated
//! or not. If it has it is equivalent to a call of
//! @[async()] and if not of @[sync()] with the same
//! arguments.
//!
//! @seealso
//! @[async()], @[sync()], @[is_async()], @[set_async()]
mixed `() (mixed ... args)
{
mixed data = ctx->encode_call(objectid, name, args,
...
...
@@ -23,34 +37,58 @@ class Call {
return 0;
}
//! Call the wrapped remote function synchronously.
//!
//! @param args
//! Arguments to send to the remote function.
//!
//! @returns
//! Returns (the possibly wrapped) result from
//! the remote function.
//!
//! @seealso
//! @[async()], @[`()()]
mixed sync(mixed ... args)
{
mixed data = ctx->encode_call(objectid, name, args, CTX_CALL_SYNC);
return con->call_sync(data);
}
//! Call the wrapped remote function asynchronously.
//!
//! @param args
//! Arguments to send to the remote function.
//!
//! @seealso
//! @[sync()], @[`()()]
void async(mixed ... args)
{
mixed data = ctx->encode_call(objectid, name, args, CTX_CALL_ASYNC);
con->call_async(data);
}
//!
//! Check whether the wrapped function actually
//! exists at the other end.
int exists()
{
mixed data = ctx->encode_call(objectid, name, ({}), CTX_EXISTS);
return con->call_sync(data);
}
//! @returns
//! Whether asynchronous mode is active or not.
//!
//! @seealso
//! @[set_async()]
int is_async()
{
return _async;
}
//! Change to/from asynchronous mode.
//!
//! @seealso
//! @[is_async()]
void set_async(int a)
{
_async = a;
...
...
@@ -670,7 +708,10 @@ class Connection {
}
}
//! Remote context tracker.
//!
//! This class keeps track of what local things correspond
//! to what remote things, and the reverse.
class Context {
object server_context;
object con;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment