Skip to main content

client for object passing

Project description



License: DEL

opject

Object Passing Library

Contents

About

opject is a specification and implementation for passing objects through the network.

An object is a self-contained piece of code.

The passing of the object through the network is obtained in 2 steps:

  • a registered object is requested by the opject client from the opject server;
  • the opject client instantiates or runs in a virtual machine the received object.

opject has clients for

The opject server can serve any kind of object. However, depending on the preferred language, a specific opject server can be used for

The opject registry grants extended functionality through a web interface. The registry can be self-hosted or cloud-hosted.

Install

Install by running

pip install opject-client

Usage

The opject client requires a server. The server can be self-hosted or cloud-hosted.

The simplest use-case implies registering an opject, requiring, and running it.

from opject_client import Client as OpjectClient


endpoint = 'http://server.address'
token = 'secret_token_obtained_from_server'

opject_id = 'some-opject-python'
# Optional name.
opject_name = 'SomeOpject'

opject_data = 'class SomeOpject:\n\tdef __init__(self):\n\t\tself.internal = 12\n\tdef read(self):\n\t\treturn self.internal\n'
## The data can also be a multiline string.
# opject_data_multiline = """
# class SomeOpject:
#     def __init__(self):
#         self.internal = 12

#     def read(self):
#         return self.internal
# """


opject_client = OpjectClient(
    endpoint = endpoint,
    token = token,
)
opject_client.register(
    opject_id,
    opject_data,
)
some_opject = opject_client.require(
    id = opject_id,
    name = opject_name,
)
value = someOpject.read() # 12

Packages

Version

@plurid/opject-client-javascriptJavaScript opject client

Version

@plurid/opject-server-javascriptJavaScript opject server

Version

@plurid/opject-client-pythonPython opject client

Version

@plurid/opject-server-pythonPython opject server

Codeophon

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opject-client-0.0.0.tar.gz (3.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page