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

should not throw when getting non-existant keys #1

Closed
wants to merge 1 commit into from

Conversation

Raynos
Copy link

@Raynos Raynos commented Oct 1, 2012

No description provided.

@juliangruber
Copy link
Contributor

+1 for this. without that kv won't work with scuttlebutt on the server

@juliangruber
Copy link
Contributor

This works but is ugly:

kv.has(key, function (err) {
  if (err) {
    onSync()
  } else {
    model.on('sync', onSync)
    kv.get(name).pipe(model.createWriteStream())
  }

  function onSync() {
    model.createReadStream().pipe(kv.put(name, { flags : 'a' }))
  }
})

@dominictarr
Copy link
Owner

This patch is wrong, It doesn't open the gate if there is no has fails, so end won't be emitted.
also, I don't really think you want an empty stream. that is weird. this behaviour seems more surprising,

Currently, this has the same behavior as fs, to emit 'error'

@Raynos
Copy link
Author

Raynos commented May 15, 2014

Closing this due to staleness

@Raynos Raynos closed this May 15, 2014
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.

None yet

3 participants