Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureTopicExists ¶
func EnsureTopicExists(bootstrapServers string, topicName string, numPartitions uint, replicationFactor uint, retentionHours uint)
numPartitions 0 means "try read from KAFKA_NUM_PARTITIONS env var", if it is not defined, use default. replicationFactor = 0 means "try read from KAFKA_REPLICATION_FACTOR env var", if it is not defined, use default. retentionHours = 0 means "try read from KAFKA_RETENTION_HOURS env var", if it is not defined, use default.
Types ¶
type JobQueueProducer ¶
type JobQueueProducer struct {
// contains filtered or unexported fields
}
func NewJobQueueProducer ¶
func NewJobQueueProducer(bootstrapServers string, topicName string) JobQueueProducer
func (*JobQueueProducer) Close ¶
func (p *JobQueueProducer) Close()
func (*JobQueueProducer) Enqueue ¶
func (p *JobQueueProducer) Enqueue(jobKey string, jobBody []byte)
Blockes until the job delivery is received from the cluster
type JobQueueWorker ¶
type JobQueueWorker struct {
// contains filtered or unexported fields
}
func NewJobQueueWorker ¶
func (*JobQueueWorker) Close ¶
func (w *JobQueueWorker) Close()
func (*JobQueueWorker) Run ¶
func (w *JobQueueWorker) Run(c chan<- Job, confirmationChannel <-chan int, stopChannel <-chan int)
Run the worker loop. The jobs are pushed to the channel "c".
func (*JobQueueWorker) TryGetNextJob ¶
Click to show internal directories.
Click to hide internal directories.