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 support for watching nil prefix in subscriber API #1246

Merged
merged 2 commits into from
Mar 13, 2020

Conversation

jarifibrahim
Copy link
Contributor

@jarifibrahim jarifibrahim commented Mar 5, 2020

This PR adds support for empty prefixes in subscribe API. This issue was discovered in https://discuss.dgraph.io/t/how-to-subscribe-to-dgraph-changes/6065/3?u=ibrahim

To subsribe to all changes in badger, user can run

db.Subscribe(ctx, handler, nil)

or

db.Subscribe(ctx, handler, []byte{})

This change is Reviewable

Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ashish-goswami)

@jarifibrahim jarifibrahim merged commit c6c1e5e into master Mar 13, 2020
@jarifibrahim jarifibrahim deleted the ibrahim/fix-subscribe-documentation branch March 13, 2020 15:12
jarifibrahim pushed a commit that referenced this pull request Mar 13, 2020
This PR adds support for watching empty prefixes (all keys) in subscribe API.

To subscribe to all changes in badger, user can run
```go
db.Subscribe(ctx, handler, nil)
```
or
```go
db.Subscribe(ctx, handler, []byte{})
```

(cherry picked from commit c6c1e5e)
jarifibrahim pushed a commit that referenced this pull request Mar 24, 2020
This PR adds support for watching empty prefixes (all keys) in subscribe API.

To subscribe to all changes in badger, user can run
```go
db.Subscribe(ctx, handler, nil)
```
or 
```go
db.Subscribe(ctx, handler, []byte{})
```

(cherry picked from commit c6c1e5e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants