This is an old revision of the document!
Attraction/proximity
To discover objects of same kind “attraction/proximity” mechanism is used. It is based on special “Subscription” object providing method “attractor” that results in multidimension KV list defining “attractor hash key” (AHK). The key is used by Router to route the object to Matcher node using DHT-like scheme. It sits there until its TTL expires (future: when its resource limit is exhausted).
Published Data Objects might provide “attractor” method. In this case Router forwards the objects to relevant Matcher.
The Matcher is likely to have many Subscription and Data objects with the same AHK and needs a way to rank and filter results.
The Matcher uses method “proximity” on Subscription object on each matching object to find proximity score. This and amount of “matching” objects define amount of references to objects to be sent to Attration initiator.
Sample flow for case “Need to find nearby female babysitter not younger than 13 tonight, with budget of 20 nis per hour. Minimum 4 hours”:
- A parent creates Object of kind Attraction with objects filter “BabySitter” with mandatory (geolocation) and voluntary (gender, “min age”, “max age”, availability hours and budget per hour might) fields. Same operation creates Object “
HMMMMM
The object has reference to object→method that is to be called on each match - likely notifications generator. The object is at work in three places:- At Matcher node, that handles the AHK. The node forwards top 10 matching objects (in order of proximity) to realm of the Subscrption object through its Router.
- At Router node, that acts on behalf of the realm - here it forwards matching objects to Realm node
- At Realm node itself - here the callback is called for each matching object
- The Object is exported and hits Router, that uses method “attractor” to get AHK. The object is then forwarded it to corresponding Matcher node.
- A girl publishes Object of kind “BabySitter” with fields: gender, geolocation. Other optional fields age, availability hours and minimum payment per hour might also be specified.
- The Object is exported and hits her Router, that usecalculates hash Person-Gender-Geo and forwards it to Matcher node using DHT lookup.
- Matcher node matches Attractor and matching objects, uses “proximity” method to create list of candidates, ordered by proximity score, to be sent back to User (via his Router node).
- Once on User's node, method “MatchFound” is called with array of candidate objects. It might then create results popup notification or show results.
