Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three projects in one! :) #6

Open
shimaore opened this issue Nov 12, 2013 · 13 comments
Open

Three projects in one! :) #6

shimaore opened this issue Nov 12, 2013 · 13 comments

Comments

@shimaore
Copy link

What I mean is that the project encompasses:

  • a project that does "discovery over CouchDB" (share-*)
  • a project that does "signalling over CouchDB" (p-signal-*)
  • a project that does "PouchDB over DataChannel"

and it could be useful to see those as separate entities. (For example it'd definitely be nice to be able to use the "PouchDB over DataChannel" piece to experiment with different discovery / signalling pieces.)

Right now discovery and signalling are definitely mixed together (in SharePouch).

The "PouchDB over DataChannel" piece is kinda in PeerPouch but not fully.
One thing I noticed is that rpc (rpc.bootstrap(..) etc.) is in SharePouch but never used there, maybe those three lines could move to the beginning of PeerPouch right after the handler is identified? (In which case _wrappedAPI wouldn't have to be exposed outside of PeerPouch either since that's the only place it's used.)

Maybe I'm just overthinking this, trying to wrap my head around the various components. :)

@shimaore
Copy link
Author

For example here's a start at trying to make PeerPouch into a browserifiable set of modules, changing the APIs a little bit to make the modules be more self-contained:
shimaore/pouchdb-calendar@14c349e

@natevw
Copy link
Owner

natevw commented Nov 13, 2013

Fun! I'm not sure how useful each component would be in isolation (e.g. CouchDB isn't exactly a great way to signal unless the only tool you allow yourself is PouchDB) and I want to avoid forcing users to have any particular build system — BUT there's certainly room for making the code a bit more modular.

Your summary is fairly accurate. Thanks for writing that out. The one correction I'd make is that there is a separation between the RPC in SharePouch vs. PeerPouch. There is a piece around PeerPouch._shareInitializersByName that is sort of a hack that crosses the concerns in kind of a hacky way between the two, but the rpc.bootstrap is pretty core: PeerPouch is the "client" I guess you could say while SharePouch is more of the "server". So the rpc.bootstrap there is quite critical, as it is what the server uses to actually expose its interface to the client.

Anyway, if you think PeerPouch would be more useful split up that's encouraging and I'd love to support it. My main thing is I want to keep it simple/easy for casual users, so if it ends up getting split across separate files internally I'd want to still provide a pre-built script that can be dropped in.

@shimaore
Copy link
Author

My main thing is I want to keep it simple/easy for casual users

No worries, I'm only toying with ideas and some code at this point, not my intent to force anyone on any path.

I'm trying to get to a point where I can initiate mobile-to-mobile browser-to-browser PeerPouch sync using (for example) QR codes -- i.e. the mobile browser "initiating" the connection displays SDP as QR code (inside the browser), while the mobile "receiving" scans the QR code, paste its text in browser application, and sync is initiated. Once I get that basic stuff working, iterate and refine the idea.

Thank you for the details about rpc, I'll review those tomorrow, it's getting quite late here!

@natevw natevw closed this as completed Nov 13, 2013
@natevw natevw reopened this Nov 13, 2013
@natevw
Copy link
Owner

natevw commented Nov 13, 2013

(Ooops, wrong button.) Sounds like a very fun reason to try separating out the signalling stuff! You'll likely want to gather ICE candidates for a bit before generating the QR code, BTW.

@natevw
Copy link
Owner

natevw commented Dec 19, 2013

HI @shimaore — I've got another developer interested in using just one of these "projects". Is your split-out version working and do you mind if I pull back your files here?

My plan is to split out at least the PeerConnectionHandler and RPCHandler into ± separate projects (at least separate package.json) and try adding a browserify build step so that there's still a single file folks can drop in for "PeerPouch" but improve the separation/reusability for other things.

@shimaore
Copy link
Author

Is your split-out version working

I have no idea, I never got to actually testing my changes.

and do you mind if I pull back your files here?

None at all, it is your code with a few copy & paste, really!

@alexgorbatchev
Copy link

curious what is the status of this?

@natevw
Copy link
Owner

natevw commented Feb 20, 2014

This still really needs to happen, I got broadsided with a ton of last-minute client work early this month (can't really complain too much I guess) and all my open source stuff (/other client work) got pretty much completely off the radar.

Could you share more about your use case? For me, splitting it up is mostly so I and others can use the pieces elsewhere and I don't know how much it will immediately benefit PeerPouch itself.

@nicopace
Copy link

Other usecase could be when you are using pouchdb inside a mobile app through Cordova/Phonegap, you could use this for signaling/discovery: http://developer.android.com/training/connect-devices-wirelessly/nsd.html

@natevw
Copy link
Owner

natevw commented Feb 17, 2015

That'd be an interesting experiment — IIRC, at one point I was sending a pre-built offer to the "hub" database like you might do with an mDNS TXT record like Bonjour/NSD use. I'm not sure if multiple parties can reply to the same offer though, but worth a try!

@nicopace
Copy link

On Tue, Feb 17, 2015 at 1:50 PM, Nathan Vander Wilt <
notifications@github.com> wrote:

That'd be an interesting experiment — IIRC, at one point I was sending a
pre-built offer to the "hub" database like you might do with an mDNS TXT
record like Bonjour/NSD use. I'm not sure if multiple parties can reply to
the same offer though, but worth a try!

That's the idea in mDNS!


Reply to this email directly or view it on GitHub
#6 (comment).

Ing. Nicolás Pace

@nicopace
Copy link

Do you have any implementation plan for this feature?

@natevw
Copy link
Owner

natevw commented Feb 17, 2015

This is a bit lower than fermata and node-nrf on my list especially since I'm not working on a project that uses this at the moment. (Though I have at least one little idea…) So while I'd like to get back to it (and have had a bit more time for catching up on open source projects lately) I don't want to make any timeline promises since time tends to fly with these things.

The code is somewhat isolated internally, so the main work would be refactoring that and then splitting at least into separate files (if not separate modules and even repos). I think https://github.com/quartzjer/webrtc-peer has some of the more generic "WebRTC wrapper" code split out, so that might be useful at least in the [potentially long] interim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants