Shaulbm / moovNowMVP

0 stars 0 forks source link

KPBE - ably integration #733

Open Shaulbm opened 1 month ago

Shaulbm commented 1 month ago

integrate ably integration for self initiated events

There are two stages to this:

  1. Manage to get any data to the ably channel.
  2. Create a utility for the KPBE to use to send data to a specific channel.

for #2:

Create a utility - a channel for data transfer to a specific ably channel. Implement a method that gets two parameters, the channel id and the data. in order to simplify the internal usage, the data will be a child class of BaseObj

As all pydantic classes support a native conversion to JSON, it should be easy to convert the given data to JSON and send it to the channel. edit: as BaseObj supports toJSON just use it - even simpler.

for the actual method expected def sendData(channelId: str, data:BaseObj)

NoamRivlin commented 1 month ago

unclear instructions details - "... method that get's data dictionary ..." which data? from where?

plan breakdown:

Shaulbm commented 1 month ago

unclear instructions details - "... method that get's data dictionary ..." which data? from where?

I have an even better idea - dropping the dictionay to baseObj. you are writing an infra that will be used - the idea behind this was to write this kind of method: def sendData(channelId: str, dataObj : BaseObj) - we will use the serialize method to send a dictionary