-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
We gathered some questions and a few suggestions regarding the proposed Rust COM API in its current state (main_api_rs branch, commit 22ae299).
InstanceSpecifierstruct:- 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. - Is an
InstanceSpecifierunique in a system? Otherwise, if several producers are allowed to use the same specifier, shouldn't it rather be calledServiceSpecifieror similar?
- Is the concrete representation of the instance specifier dependant on the backend? If yes, it should instead be a trait:
Runtimetrait:- This should be renamed. For example, to
TransportLayerorIpcAdapter.
- This should be renamed. For example, to
Producer/OfferedProducer:- Is a producer already visible for service discovery, or is it visible only once it has been offered?
- Maybe replace the type distinction with internal
offeredflag? 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. - Can
offer()/unoffer()block? If yes, should they beasync? What are the exact semantics of those methods? - What happens if a consumer doesn't release a sample? Will
unoffer()block indefinitely? What if the consumer crashes while holding a sample?
ConsumerDescriptor:- Shouldn't this rather be called
ProducerDescriptor, since it's the result of service discovery? And itsget_instance_id()method returns the ID of the producer, right?
- Shouldn't this rather be called
- Service discovery:
- 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?
- Which kind of specifier is passed to
- Use of builder pattern:
- The
Buildertrait seems unnecessary. Why would you ever want to be generic over all possible builders? User seems to be overloaded in caliing build(). Something likeVec<&mut dyn Builder>doesn't really make sense. - The
ProducerBuildertrait shouldn't be a part of the COM API, since it's not being used by any other part of the COM API.
- The
- Architecture:
- Would a more convenient interface for building consumers also be acceptable, where the backend handles the service/producer discovery?
- 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