Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for redis queue. #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SimonXming
Copy link

Add basic support for redis queue.

Copy link
Contributor

@bradrydzewski bradrydzewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely think a redis client would be awesome. Added some initial comments. Also needs unit tests :)

redis/opts.go Outdated

// WithProject configures the Pubsub client with the named project.
func WithRedisAddr(addr string) Option {
return func(opts *Options) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can name WithAddr since the package name will be used by package consumers redis.WithAddr

redis/opts.go Outdated
// Option configures the Google Cloud pubsub client.
type Option func(*Options)

// WithProject configures the Pubsub client with the named project.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update comment

redis/opts.go Outdated
}
}

func WithRedisPassword(password string) Option {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to redis.WithPassword

redis/opts.go Outdated
}
}

func WithRedisDB(db int) Option {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to redis.WithDB

redis/opts.go Outdated
}
}

func WithRedisQueueName(queueName string) Option {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to redis.WithQueueName


opts *Options
client *redis.Client
running map[string]*entry
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should store this information in redis so that we can restart the redis server or drone server without losing the state of the queue.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will try. thanks for reply.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bradrydzewski is this ok?

Copy link
Author

@SimonXming SimonXming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants