MCPcopy
hub / github.com/IBM/sarama / NewSyncProducerFromClient

Function NewSyncProducerFromClient

sync_producer.go:96–106  ·  view source on GitHub ↗

NewSyncProducerFromClient creates a new SyncProducer using the given client. It is still necessary to call Close() on the underlying client when shutting down this producer.

(client Client)

Source from the content-addressed store, hash-verified

94// NewSyncProducerFromClient creates a new SyncProducer using the given client. It is still
95// necessary to call Close() on the underlying client when shutting down this producer.
96func NewSyncProducerFromClient(client Client) (SyncProducer, error) {
97 if err := verifyProducerConfig(client.Config()); err != nil {
98 return nil, err
99 }
100
101 p, err := NewAsyncProducerFromClient(client)
102 if err != nil {
103 return nil, err
104 }
105 return newSyncProducerFromAsyncProducer(p.(*asyncProducer)), nil
106}
107
108func newSyncProducerFromAsyncProducer(p *asyncProducer) *syncProducer {
109 sp := &syncProducer{producer: p}

Callers 3

Calls 4

verifyProducerConfigFunction · 0.85
ConfigMethod · 0.65

Tested by 3