Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 1.54 KB

README.md

File metadata and controls

51 lines (37 loc) · 1.54 KB

firequeue

Test Status Coverage Status MIT License PkgGoDev

firequeue is to ensure putting items to Amazon Kinesis Data Firehose with an in-memory queue

Synopsis

import (
    "context"

    "github.com/aws/aws-sdk-go/aws/session"
    "github.com/aws/aws-sdk-go/service/firehose"
)

func main() {
    sess := session.Must(session.NewSession())
    fh := firehose.New(sess)
    fq := firequeue.New(fh, "DELIVERY_STREAM_NAME")

    ctx := context.Background()
    go fq.Loop(ctx) // We should start looping before sending items

    err := fq.Enqueue(&firehose.Record{...})
    ...
}

Description

The firequeue utilizes an in-memory queue to ensure input to Amazon Kinesis Data Firehose. When the looping process is cancelled by the context, the firequeue wait for the queue to be empty and then exit the loop.

Installation

% go get github.com/natureglobal/firequeue

Author

Songmu