--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/4B6RDHriNak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/EFCB7EE0-6B10-44BC-A96F-40AF12F86681%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.
On Oct 17, 2017, at 4:13 PM, Matias Piipari <matias....@gmail.com> wrote:Creating an equivalent higher level API in Node.js executable ES7 (or TypeScript) which behind the scenes calls to the same C++ APIs, using the public Swift API as a guide for API design should not be impossible.
I guess a key question is whether it's a sensible time to try such a thing (the README in the CBL repo states that the CBL API is in flux, in early stage of development etc). Should I wait?
On Oct 17, 2017, at 4:13 PM, Matias Piipari <matias....@gmail.com> wrote:Creating an equivalent higher level API in Node.js executable ES7 (or TypeScript) which behind the scenes calls to the same C++ APIs, using the public Swift API as a guide for API design should not be impossible.I agree. I’m not sure how the actual inter-language glue would work; I have some experience with binding V8 to C++ but that was back in 2009. Hopefully it can be automated to the extent of exposing JS functions corresponding to the C API.
I guess a key question is whether it's a sensible time to try such a thing (the README in the CBL repo states that the CBL API is in flux, in early stage of development etc). Should I wait?The CBL 2 API has mostly settled down by now. There are some changes to the Document API we’re discussing internally, to make thread-safety easier to achieve and to simplify naming, but they shouldn’t have a big impact on a JS binding.
--—Jens
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/4B6RDHriNak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/D20031DF-FA96-4C19-BAA5-42E35F624CAB%40couchbase.com.
On Oct 18, 2017, at 5:42 AM, Matias Piipari <matias....@gmail.com> wrote:What's the status of the C / C++ APIs, in that they are at least not noted to intended as the "public" API? Does that mean that they are to go substantial changes and some stabler / smaller subset is to be introduced still? Or have I just hit some out of date documentatioN/
The precise way in which V8 handles thread isolation I bet will actually cause some pain. If the threading behaviour was like in CBL for iOS / macOS 1.x like I have potential solutions in mind. Could you explain more about the threading model, and what you describe as making threadsafety easier, in couchbase-lite-core?
On Oct 18, 2017, at 5:42 AM, Matias Piipari <matias....@gmail.com> wrote:What's the status of the C / C++ APIs, in that they are at least not noted to intended as the "public" API? Does that mean that they are to go substantial changes and some stabler / smaller subset is to be introduced still? Or have I just hit some out of date documentatioN/LiteCore’s C API is not considered public; it’s an internal API for use by implementations of Couchbase Lite, it can change without notice, etc. That being said, we try to limit incompatible changes because they require coordination between the three current CBL implementations. (I did just commit one yesterday, though.)
We would like to have a public C/C++ API for developers to use, which would be considered a new platform of Couchbase Lite, but that’s something for the future.
The precise way in which V8 handles thread isolation I bet will actually cause some pain. If the threading behaviour was like in CBL for iOS / macOS 1.x like I have potential solutions in mind. Could you explain more about the threading model, and what you describe as making threadsafety easier, in couchbase-lite-core?I just finished writing a wiki document on LiteCore thread safety. In a nutshell: LiteCore doesn’t care what threads it’s called on, but generally doesn’t allow multiple concurrent calls involving the same database (or objects derived from the database, like documents or queries.) The document spells out the concurrency limitations of every API call.
--—Jens
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/4B6RDHriNak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/ADA3DF60-C429-49A7-A489-CDF73CA8F601%40couchbase.com.
On Wed, Oct 18, 2017 at 4:57 PM, Jens Alfke <je...@couchbase.com> wrote:On Oct 18, 2017, at 5:42 AM, Matias Piipari <matias....@gmail.com> wrote:What's the status of the C / C++ APIs, in that they are at least not noted to intended as the "public" API? Does that mean that they are to go substantial changes and some stabler / smaller subset is to be introduced still? Or have I just hit some out of date documentatioN/LiteCore’s C API is not considered public; it’s an internal API for use by implementations of Couchbase Lite, it can change without notice, etc. That being said, we try to limit incompatible changes because they require coordination between the three current CBL implementations. (I did just commit one yesterday, though.)This sounds good. Do you follow some pattern for noting commits or release note entries where C API changes are introduced?ÂI've started experimentally putting together a node-ffi based wrapper using the C API, thus far things are working (on macOS anyway – I've logged some issues regarding compilation on Linux presently) with a few API calls mapped as a test. I think I'll write the real thing in TypeScript so that I can use enums for the typedef equivalents and for the Swift / Objective-C API higher level type equivalents (many of the same of which make sense to provide).ÂWe would like to have a public C/C++ API for developers to use, which would be considered a new platform of Couchbase Lite, but that’s something for the future.Nice, and also understandable why that's for the future.The precise way in which V8 handles thread isolation I bet will actually cause some pain. If the threading behaviour was like in CBL for iOS / macOS 1.x like I have potential solutions in mind. Could you explain more about the threading model, and what you describe as making threadsafety easier, in couchbase-lite-core?I just finished writing a wiki document on LiteCore thread safety. In a nutshell: LiteCore doesn’t care what threads it’s called on, but generally doesn’t allow multiple concurrent calls involving the same database (or objects derived from the database, like documents or queries.) The document spells out the concurrency limitations of every API call.Great, this may even work. :-)Â
—Jens
--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/4B6RDHriNak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/ADA3DF60-C429-49A7-A489-CDF73CA8F601%40couchbase.com.
On Oct 22, 2017, at 5:20 PM, Matias Piipari <matias....@gmail.com> wrote:This sounds good. Do you follow some pattern for noting commits or release note entries where C API changes are introduced?Â
On Oct 24, 2017, at 3:58 AM, Erik Porsche <e.po...@gmail.com> wrote:I have a conceptual question regarding this topic. Instead of building a wrapper using node-ffi or edge-js (when building on top of couchbase-lite-net) - is it maybe better to wait for this issue to be solved:Â https://github.com/couchbase/couchbase-lite-core/issues/19Â ?
On Nov 13, 2017, at 5:24 PM, Matias Piipari <matias....@gmail.com> wrote:1. Are there any asynchronous callbacks involved in the C API level (for example from database observers) which would fire (as a feature, not a bug) on a different thread than the thread on which the database API calls are otherwise executing? This would lead to some special considerations given the V8 model of thread isolation.
2. Is it correct that for any C4Slice / C4String / ... with malloced buf to it, the C4 APIs I passed them to do not take ownership (i.e. that I am responsible for freeing it at the end I created it)?
On Nov 13, 2017, at 5:24 PM, Matias Piipari <matias....@gmail.com> wrote:1. Are there any asynchronous callbacks involved in the C API level (for example from database observers) which would fire (as a feature, not a bug) on a different thread than the thread on which the database API calls are otherwise executing? This would lead to some special considerations given the V8 model of thread isolation.Database/document observers can be called on another thread (specifically, on a thread on which a different C4Database is committing a transaction.)Replication callbacks are called on background threads belonging to the replicator.
2. Is it correct that for any C4Slice / C4String / ... with malloced buf to it, the C4 APIs I passed them to do not take ownership (i.e. that I am responsible for freeing it at the end I created it)?Yes. C4Slices are ephemeral. If you pass one to a function, LiteCore won't access that memory after the function returns.
--—Jens
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/4B6RDHriNak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/F24D749D-F52E-4FF9-9A62-287786F32132%40couchbase.com.