Giter VIP home page Giter VIP logo

python-remote's Introduction

Simple RPC client/server in pure python, allowing transparent access to the remote objects.

Developed and tested in Python 2.5 and 2.7.

What is it:
   1) Take some application, supporting Python (such as Golly).
   2) In that application, create and run the RPC server from this script (PythonServer class)
   3) Now in the regular Pyhton script, you can do the following:
      #Create client
      client = FarSide( ... some appropriate parameters here ... )
      #Import module, available only at the server
      remote_golly = client.import_module( "golly" )  
      #call any method of theremote module.
      remote_golly.message( "Hello" )
      
   All calls to the remote objects are serialized, sent to the sever via socket, then executed on the server, and results are received on the client. Everything is done absolutely transparently, client can work ith remote objects in the absolutely same way as if they were available locally.

   Not only modules can be remoted: any object can be (remember, that functions, methods etc are also objects in Python).

   If you have a remote function, that expects a remote object as argument, you can call this function without any additional work. 


Possible usages:
  - Integration of many Python-enabled applications in one script.
  - Centralized testing of the applications, providing Python interface.

Drawbacks:
  It is slow. Each call to the remote method involves serialization (with pickle), transfer via socket and deserialization.



Classes:

   PythonServer - server object. SHould be created in the application.
   FarSide - client object. Gives transparent access to the objects, exposed to the server.


Files:
   python_remote.py - the library itself.
   pysock_server.py - sample server code.
   pysock_client.py - sample client code.

python-remote's People

Contributors

dmishin avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.