|tldr - Actually you could Thalize LittleOutliner today. The pieces really do exist.
O.k., first, that is cool. It's all theory until you see the bits fly!
How to set up LittleOutliner in Thali Land
But let's talk about the ideal set up here.
Chrome using PouchDB who is talking to Thali over the native host. PouchDB would be a client of the Thali Device Hub. All of this is doable (modulo a few minor bugs I need to fix) right now.
Computer A would have the user typing.
Computer B would have the user receiving the updates.
(Yes, everything will work bi-directionally but I'm going to talk about a single direction to make the set up easier to understand)
So on Computer A pouchDB would set up a push replication from Computer A's Thali Device Hub (TDH) to Computer B's TDH. This would be set up by using PouchDB to issue a continuous push replication request to the machine's TDH. That all works today other than
the push replication bug I introduced that I'm in the middle of fixing.
Getting notifications of changes on computer B
The main problem on Computer B is - how does it know when its TDH has been updated by Computer A's TDH? In the short term the answer is that we should set up a continuous replication between PouchDB on Computer B and it's local Thali Device Hub. In other words
we will suck changes from computer B's TDH into the browser. We would then hook the change logic so we would get automatically notified anytime an update comes in and then we would delete the record in the browser since we don't need it after we have been
notified about it. To be honest I'm not 100% sure PouchDB will handle this scenario. Since you have PouchDB hooked up to couch could you try to set up a continuous replication from Couch to your PouchDB and see what happens? I looked through the PouchDB source
code but I didn't see a timer jumping out at me so I'm not sure if a continuous pull replication will actually work. I also know that there is an outstanding bug in PouchdB's support for replicating attachments (see
) but this mechanism should be used for message updates (e.g. JSON) and not for the core attachments. So I think we should be fine.
Note that if PouchDB doesn't support continuous pull replications (read: polling) then it's easy enough to set up our own polling by just setting up a timer to initiate a one time pull replication and see if anything new shows up.
So one way or another this IS doable, right now, without any serious voodoo.
In the longer term I really want to set up a server that PouchDB can listen to so we can switch from pull to push (I even have a bunch of the code needed to make this work) but honestly I don't think that polling a local server is all that bad and I'd like
to keep things simple for now.
So, my point is, everything you need to 'thalizie' your Demo actually exists, right now (modulo me fixing the push replication bug which will happen once I stop writing email and get back to code =).
Making it peer to peer
The only gotcha I see is how to set up the peer to peer connection itself. The problem is the Android VM. It won't accept incoming connections from off machine and I've tried to use net bridges, relays, etc. to fool it without success. However there is explicitly
some voodoo to let you configure two Android VMs on the same box and set up a local network between them. I've never actually tried it though. You would then assign each VM's TDH a different port (e.g. 9898 and 9899) and Computer 'A' (just a Chrome instance)
would use 9898 and Computer 'B' (another Chrome instance) would use 9899 and you are in business.
Another alternative is to use two different computers but then you need to use an Android Device on computer B so it can be pushed changes from computer A. Once I add in Tor support (next on my todo list after fixing push replication) that problem goes away
and you can just use two VMs on two machines.
Of course once the CouchBase Lite folks get the Java support up and running for CouchBase Lite then this all gets much simpler since the connection limitations of the Android VM wouldn't apply at all in that case.
But, long story short - you really and truly can Thalize LittleOutliner today!