couchbase-lite-core icon indicating copy to clipboard operation
couchbase-lite-core copied to clipboard

REST listener improvements for liteserv

Open snej opened this issue 1 year ago • 1 comments

This branch contains all the LiteCore enhancements & fixes needed to implement the liteserv server.

  • Implemented the _changes endpoint of the REST API, all 3 modes (normal, longpoll, continuous.) The latter two modes often have to block waiting for new changes; the implementation using Listener::Task ensures these idle connections aren't blocking a thread or locking a database, so it should be very scalable.
  • Implemented a new _query endpoint for running queries.
  • Lots of changes to the _replicate endpoint:
    • collection support
    • channel & docID filter support
    • doesn't block until the replication completes (that way the client gets the session_id and can cancel it)
    • simplified the cancel API to take the session_id
    • added a C4Listener method to start a replication task
  • I made a bunch of improvements to the RequestResponse class, like chunked-encoding support, and the ability to flush output to the socket before finishing the request (so long responses don't allocate a lot of memory.)

snej avatar Aug 23 '24 00:08 snej

Code Coverage Results:

Type Percentage
branches 66.42
functions 79.0
instantiations 33.64
lines 77.93
regions 73.76

cbl-bot avatar Aug 23 '24 23:08 cbl-bot