Skip to content

Instantly share code, notes, and snippets.

View r4mbo7's full-sized avatar
🦊
https://gitlab.com/cdlr75

De La Roche Constantin r4mbo7

🦊
https://gitlab.com/cdlr75
View GitHub Profile
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@floer32
floer32 / python_bind_function_as_method.py
Created February 11, 2015 01:42
Bind Python function as method
# based on: http://stackoverflow.com/questions/1015307/python-bind-an-unbound-method#comment8431145_1015405
def bind(instance, func, as_name):
""" Turn a function to a bound method on an instance
.. doctest::
>>> class Foo(object):
... def __init__(self, x, y):
... self.x = x
... self.y = y