Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumHandler ¶
type ConsumHandler struct { AtSubscribe ConsumedMessageHandler AtError stream.ErrHandler AtNotified NotificationHandler }
ConsumHandler consum 이벤트에 맞춰 실행될 핸들러
func DefaultConsumHandler ¶
func DefaultConsumHandler() *ConsumHandler
DefaultConsumHandler 기본 핸들러 생성
type ConsumedMessageHandler ¶
type ConsumedMessageHandler func(*sarama.ConsumerMessage)
ConsumedMessageHandler consumer가 메세지를 받을때, 실행된다.
type ConsumerGroup ¶
type ConsumerGroup struct { Consumer *cluster.Consumer Handler ConsumHandler // contains filtered or unexported fields }
ConsumerGroup sarama cluster를 이용한 consumer
func NewConsumerGroup ¶
func NewConsumerGroup(groupName string, addrs, topics []string, handler *ConsumHandler) *ConsumerGroup
NewConsumerGroup consumer group 생성
func (*ConsumerGroup) Subscribe ¶
func (cg *ConsumerGroup) Subscribe(call ConsumedMessageHandler)
Subscribe broker로 부터 메세지를 구독한다.
type NotificationHandler ¶
type NotificationHandler func(*cluster.Notification)
NotificationHandler consumer가 broker로 부터 알림을 받을때, 실행
type ProceedMessageHandler ¶
type ProceedMessageHandler func(*sarama.ProducerMessage)
ProceedMessageHandler 메세지가 broker로 전달된 후 실행되는 핸들러
type ProducerStream ¶
type ProducerStream struct { Producer sarama.AsyncProducer AfterSend ProceedMessageHandler ErrFrom stream.ErrHandler *stream.Observer // contains filtered or unexported fields }
ProducerStream sarama AsyncProducer를 이용한 stream 구조체
func NewProducerStream ¶
func NewProducerStream(addrs []string, obv *stream.Observer) *ProducerStream
NewProducerStream stream 생성
func (*ProducerStream) Publish ¶
func (ps *ProducerStream) Publish(target func())
Publish Observable의 데이터를 구독한 후 broker로 메세지를 전송한다.
func (*ProducerStream) Send ¶
func (ps *ProducerStream) Send(msg *sarama.ProducerMessage)
Send ProducerMessage를 Subscribable에 전달
Click to show internal directories.
Click to hide internal directories.