Skip to content

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

License

Notifications You must be signed in to change notification settings

natureglobal/firequeue

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published