Coder Social home page Coder Social logo

lymph's People

Contributors

castillo avatar dbravender avatar drahflow avatar dushr avatar emulbreh avatar fenfir avatar jacqueslh avatar johbo avatar kpanic avatar kstrempel avatar lnenov avatar mamachanko avatar manisenkov avatar mislavstipetic avatar mouadino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lymph's Issues

Enabling HTTPS (SSL)

Hi Team,

I want to enable HTTPS in Lymph. where should i configure the SSL parameters for the same?

self.request() sometimes returns results when service type and method don't match.

If I call self.request with a service type that doesn't match the method name, Some of the time it generates warning like: '2015-10-16 11:40:51,205 [WARNING] lymph.core.container: unsupported service type: echo - trace_id="7c4a6eed669b44e0b0decc1189c9a02c"' and throws a lymph.RpcError, but others it returns a value.

result = self.request('lymph', 'echo.upper', { 'text' : 'delay_%f' % self.delay } )

I am not sure which is the incorrect behavior. I may not be understanding the encapsulation, but the demos made it seem as if the service type was the parent of the method name, in which case I would expect the above to fail.

Here is some code to reproduce the problem, it uses the same config as demo

from __future__ import print_function, unicode_literals

import time
import random
import gevent
import lymph
from lymph.core import trace

class Client(lymph.Interface):
    delay = 2.0

    def on_start(self):
        super(Client, self).on_start()
        gevent.spawn(self.loop)

    def apply_config(self, config):
        super(Client, self).apply_config(config);
        self.delay = config.get('delay', 2.0)

    def loop(self):
        while self.delay > .05:
            time.sleep(self.delay)
            trace.set_id()
            try:
                result = self.request('lymph', 'echo.upper', { 'text' : 'delay_%f' % self.delay } )
            except lymph.RpcError:
                print("RpcError (retry)")
                continue

            print("result = %s" % result._body)
            self.delay = self.delay / 2

WebInterface should check for correct return type

lymph fails when setting trace-id header in case the return type from WebInterface is not correct type. lymph should probably check for this and raise before.

Traceback (most recent call last):
  File "/home/eren.gueven/.virtualenvs/ars/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 508, in handle_one_response
    self.run_application()
  File "/home/eren.gueven/.virtualenvs/ars/local/lib/python2.7/site-packages/gevent/pywsgi.py", line 494, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/home/eren.gueven/.virtualenvs/ars/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 291, in application
    return f(*args[:-2] + (request,))(*args[-2:])
  File "/home/eren.gueven/.virtualenvs/ars/local/lib/python2.7/site-packages/lymph/web/interfaces.py", line 114, in dispatch_request
    response.headers['X-Trace-Id'] = trace.get_id()
AttributeError: 'NoneType' object has no attribute 'headers'

Interface name is mutable

The interface name is used to identify the interface when it is installed in a container. There is a method in the container that allows you to install interfaces.

def install_interface(self, cls, interface_name=None): 

The interface_name is associated to the interface and that is what is used to identify the interface too, including discovery.

Now when you have an interface, you can change the name of the interface if you have access to the interface instance and that will not update the container.

Eg.

echo_interface = container.installed_interfaces['echo']
echo_interface.name = 'something-else'

This would not break the request call to the the interface, but it indicates that if you change the name the of the interface you would be able to discover it with the new name runtime.

To follow the discussion and possibly a solution checkout this discussion on the PR[https://github.com//pull/37#discussion-diff-20519884]

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.