Giter Club home page Giter Club logo

channels's Introduction

Channels work via an "exchange", and can't do much until
they are bound.  A channel is bound using chan.bind(some_exchange).
Exchanges can be any object, provided they obeys the dictionary protocol.

      >>> event._exchange
      <PostOffice-Service 174661484>
      >>> event._exchange[event.__name__]
      (<bound method Terminal.push_q of <Terminal-Service 175386220>>,)

For a bound channel, both the channel and the exchange can answer
questions about the subscribers

      >>> event.subscribers()
      (<bound method Terminal.push_q of <Terminal-Service 176017164>>,)
      >>> event._exchange[event.__name__]
      (<bound method Terminal.push_q of <Terminal-Service 176017164>>,)

You can build a subchannel on the fly

      >>> event.foo
      <CHAN-(EVENT_T::foo)>

Subchannels are cached

      >>> foo_channel = event.foo
      >>> foo_channel == event.foo
      True

By default subchannels get the same exchange their parent has

      >>> event.foo._exchange==event._exchange
      True

Channels can non-recursively enumerate their subchannels

      >>> event.subchannels()
      [<CHAN-(EVENT_T::foo)>]

Push a message into the channel by simply calling it. by default,
channels should accept any number of arguments of any type.

      >>> event("testing")
      >>> event(str,object)

channels's People

Contributors

mattvonrocketstein avatar

Stargazers

 avatar

Watchers

 avatar James Cloos 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.