Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comm #907

Merged
merged 14 commits into from
Dec 17, 2024
Merged

Comm #907

merged 14 commits into from
Dec 17, 2024

Conversation

3rd-Son
Copy link
Contributor

@3rd-Son 3rd-Son commented Dec 11, 2024

@cobycloud
I have implemented the base class and core abstract class for transport
Please give it a look and let me know if I should proceed with concrete implementations and test cases

@3rd-Son 3rd-Son requested a review from cobycloud as a code owner December 11, 2024 14:28
@3rd-Son 3rd-Son changed the base branch from master to mono/dev December 11, 2024 14:28
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you
Didn't even know when I made this mistake

@3rd-Son
Copy link
Contributor Author

3rd-Son commented Dec 12, 2024

@cobycloud please review my PR

Copy link
Contributor

@cobycloud cobycloud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small changes requested. good work overall

def multicast(self, sender: str, recipients: List[str], message: Any) -> None:
raise NotImplementedError("Subclasses must implement multicast method")

def subscribe(self, topic: str, subscriber: str) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if we had an HTTPTransport base that has no inherent publish and subscribe methods?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a transport is going to offer its own external methods for subscribe and publish, then it's likely doing so via a mixin.

As such, that would require a swarmauri_core/transport/IPubSub and a swarmauri/transport/base/PubSubMixin class.

then at the concrete-level, if a transport is going to implement the IPubSub interface, it can do so via PubSubMixin,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh, now I see
Great, I understand this

from typing import Any, List


class ITransportComm(ABC):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll drop the comm part and only refer to as Transport

import datetime
from swarmauri_core.transport.ITransport import ITransport

class TransportationProtocol(Enum):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might come in handy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include test methods to test:

  • resource kind
  • type
  • serialization

Returns:
str: Unique subscriber ID
"""
subscriber_id = str(uuid4())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TransportBase inherits ComponentBase. All subclasses of ComponentBase automatically have an internal id accessible at

self.id

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @cobycloud

@cobycloud cobycloud changed the base branch from mono/dev to mono/dev-newfeatures December 17, 2024 13:50
@cobycloud cobycloud merged commit 3e4de30 into swarmauri:mono/dev-newfeatures Dec 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants