crossbario / crossbario/autobahn-python

API for prioritized / flow-controlled messaging

Open
#204 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature needs-discussion websocket
Dominant language
Python
Stars
2.5k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

class IMessage(Interface):
   """
   """
   binary  = Attribute("Flag indicating whether payload is binary.")
   priority = Attribute("Priority of message.")
   factory = Attribute("The message factory this message was created by.")
   channel = Attribute("The channel this message was created on.")
   tracker = Attribute("Optional timestamp and statistics tracker - an object that implements ITracker.")



class IInboundMessage(IMessage):
   """
   """

   def on_begin():
      """
      """

   def resume():
      """
      Resume receiving data for message.
      """

   def on_data(payload):
      """
      """

   def pause():
      """
      Pause receiving data for message.
      """

   def on_end():
      """
      """



class IOutboundMessage(IMessage):
   """
   """

   def begin():
      """
      """

   def on_resume():
      """
      Called when sending data should be resumed.
      """

   def send(payload):
      """
      """

   def on_pause():
      """
      Called when sending data should be paused.
      """

   def end():
      """
      """



class IMessageFactory(Interface):
   """
   """
   is_running = Attribute("True if factory is running.")
   factory = Attribute("The channel factory that this channel was created by.")
   tracker = Attribute("Optional timestamp and statistics tracker - an object that implements ITracker.")

   def on_start():
      """
      """

   def __call__(is_inbound = True):
      """
      Returns an object that implements IMessage.
      """

   def recycle(message):
      """
      """

   def stop():
      """
      """

   def on_stop():
      """
      """



class IMessageChannel(Interface):
   """
   """
   inbound = Attribute("The message factory for inbound messages.")
   outbound = Attribute("The message factory for outbound messages.")
   factory = Attribute("The channel factory that this channel was created by.")
   tracker = Attribute("Optional timestamp and statistics tracker - an object that implements ITracker.")

   def on_open():
      """
      """

   def send(is_binary = False, no_compress = False, priority = 0):
      """
      Returns an object implementing IOutboundMessage.
      """

   def on_message(self, message):
      """
      :param message: An object implementing IInboundMessage.
      :type message: IInboundMessage
      """

   def close(abort = False):
      """
      """

   def on_close(was_clean):
      """
      """



class IMessageChannelFactory(Interface):
   """
   """
   is_running = Attribute("True if factory is running.")
   node = Attribute("The node this message channel factory was added to.")
   tracker = Attribute("Optional timestamp and statistics tracker - an object that implements ITracker.")

   def on_start():
      """
      """

   def __call__():
      """
      Returns an object that implements IMessageChannel.
      """

   def recycle(factory):
      """
      """

   def stop():
      """
      """

   def on_stop():
      """
      """



class IMessagingNode(Interface):
   """
   """
   tracker = Attribute("Optional timestamp and statistics tracker - an object that implements ITracker.")

   def add(factory):
      """
      Add a message channel factory to this node.

      :param factory: The message channel factory to add to this node.
      :type factory: An object that implements IMessageChannelFactory
      """

   def remove(factory):
      """
      """

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file, entry point, or test is named. Start by reviewing the proposed IMessage, IInboundMessage, IOutboundMessage, IMessageFactory, IMessageChannel, IMessageChannelFactory, and IMessagingNode interfaces, then identify the project area where this API belongs. Done would require an agreed design and maintainer confirmation of the prioritized and flow-controlled messaging API.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
18/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.