Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory handles creating appropriate Kafka-Consumers and creating a result-channel for every request. Check Factory.Catch function.
func NewFactory ¶
NewFactory returns a new Factory instance.
func (*Factory) Catch ¶
func (f *Factory) Catch( group string, topic string, uuid uuuid.UUID, ) (<-chan *model.KafkaResponse, error)
Catch creates a new Kafka-Consumer if one does not exist for that specific ID. Otherwise an existing cached Consumer is returned. ID here refers to "Group+Topic" for the Consumer. This is not analogous to traditional Consumers that simply forward any Kafka Messages. This returns a new channel for every request. The request's response is then sent on that channel when the response arrives. It determines the correct response for request by using the response-UUID. If a response arrives before the request for it is registered, it caches the response until the request for it is received, and the response is sent out as soon request arrives.