Skip to content

Open questions on the mw::com Rust API #12

@awillenbuecher-xq-tec

Description

@awillenbuecher-xq-tec

We gathered some questions and a few suggestions regarding the proposed Rust COM API in its current state (main_api_rs branch, commit 22ae299).

  1. InstanceSpecifier struct:
    1. Is the concrete representation of the instance specifier dependant on the backend? If yes, it should instead be a trait: trait InstanceSpecifier<R: Runtime>. Otherwise, this struct should already contain the specifier as a field and not be empty.
    2. Is an InstanceSpecifier unique in a system? Otherwise, if several producers are allowed to use the same specifier, shouldn't it rather be called ServiceSpecifier or similar?
  2. Runtime trait:
    1. This should be renamed. For example, to TransportLayer or IpcAdapter.
  3. Producer/OfferedProducer:
    1. Is a producer already visible for service discovery, or is it visible only once it has been offered?
    2. Maybe replace the type distinction with internal offered flag? Having two different types makes it difficult to dynamically switch between those states: the current API would require deconstructing the producer/offered producer when making the switch.
    3. Can offer()/unoffer() block? If yes, should they be async? What are the exact semantics of those methods?
    4. What happens if a consumer doesn't release a sample? Will unoffer() block indefinitely? What if the consumer crashes while holding a sample?
  4. ConsumerDescriptor:
    1. Shouldn't this rather be called ProducerDescriptor, since it's the result of service discovery? And its get_instance_id() method returns the ID of the producer, right?
  5. Service discovery:
    1. Which kind of specifier is passed to find_service? Does it uniquely identify at most one producer, or can it identify a set of producers? If the latter, is the identifier allowed to contain wildcards?
  6. Use of builder pattern:
    1. The Builder trait seems unnecessary. Why would you ever want to be generic over all possible builders? User seems to be overloaded in caliing build(). Something like Vec<&mut dyn Builder> doesn't really make sense.
    2. The ProducerBuilder trait shouldn't be a part of the COM API, since it's not being used by any other part of the COM API.
  7. Architecture:
    1. Would a more convenient interface for building consumers also be acceptable, where the backend handles the service/producer discovery?
    2. Do we really want to always couple multiple single topics into one big interface? Looks like overhead.

It would be great if you could answer these questions, and we would be happy to start a discussion on the more complex issues.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions