Git Product home page Git Product logo

Comments (1)

natevw avatar natevw commented on August 19, 2024

Adding some notes for future me or whoever gets a chance to tackle this first:

The CouchDB server is started via an NSTask with pipe notifications registered on the main thread's run loop. Still paging Cocoa stuff back into the front of my mind, but based on some comments on a thread I found (http://www.cocoabuilder.com/archive/cocoa/284820-problem-with-reading-an-nspipe-nsfilehandle-to-end.html, "When you invoke -readInBackgroundAndNotify, there is a run loop source installed on the run loop associated with the current thread. That is, if you invoke -readInBackgroundAndNotify on a background thread, the run loop source is installed on the background thread's run loop.") the solution may be as simple as registering for the data notifications via a background thread that subsequently starts polling its own run loop. When a data event comes in, we can pull that data from the system pipe buffer (which is probably the "finite queue" we are seeing CouchDB act as if it has) and send it off via a performSelector to the main thread's run loop (which will retain the data until it is gotten to).

from couchdbx-core.

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.