GithubHelp home page GithubHelp logo

[nano] Follow support? about nano HOT 5 CLOSED

apache avatar apache commented on July 24, 2024
[nano] Follow support?

from nano.

Comments (5)

dscape avatar dscape commented on July 24, 2024

Yes, I considered it for a while and then decided to keep it simple until a someone complained.

It can make sense both ways: Follow to use nano to simplify CouchDB access code, and nano using Follow to provide efficient changes feed support.

If you feel strongly about this and think you can do a good job at keeping the impact to a minimum send in a pull request.

Side note: You might be interested in this project from @dominictarr - I know I was :)
https://github.com/dominictarr/couch-stream

from nano.

mikeal avatar mikeal commented on July 24, 2024

for what it's worth, follow is a dependency for replicate and it's working quite well so far.

-Mikeal

On Sep 20, 2011, at September 20, 20118:51 AM, Jason Smith wrote:

Hi, Nuno.

Is it appropriate to integrate any Follow functionality into Nano?

On the one hand, Follow also strives for simplicity and tries to mirror the request API. The other major advantage IMO is the inactivity timeout which is the only way to detect some kinds of error.

On the other hand, I am not sure if it is "feature bloat" or "mission creep" for Nano.

Do you have any thoughts about this?

Reply to this email directly or view it on GitHub:
#21

from nano.

jhs avatar jhs commented on July 24, 2024

Yeah Follow is extremely robust, but unfortunately not demonstrably so because it has zero test coverage.

For months I just ran a follow stream on my laptop and workstation while WiFi would crash, DSL would crash, I put my laptop to sleep, joined public WiFi networks, used Bluetooth and USB tethering over EDGE from 9,000 miles away, etc. If I ever found a crash I would figure out why and improve the code.

Unfortunately those sorts of situations are hard to write unit tests for, e.g. you timeout and reconnect but DNS resolution is also down. Not that that is an excuse. But I in that context succumbed to the temptation to shirk the unit tests.

from nano.

jhs avatar jhs commented on July 24, 2024

Anyway, I am thinking of adding Nano support in Follow rather than the other way. Instead of giving it a string URL, you could give it a Nano DB object. From there it would pull out the info it needs. So you could write:

// given: db is a Nano DB
var follow = require("follow");
follow(db, function(er, change) {
  if(er) throw er;
  console.dir(change);
})

If that works well, maybe we can talk later about bundling follow into Nano:

db.follow(function(er, change) {
  if(er) throw er;
  console.dir(change);
})

from nano.

dscape avatar dscape commented on July 24, 2024

Looks like a great plan for me. :)

from nano.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.