To discover objects of same kind “attraction/proximity” mechanism is used. It is based on special “Attraction” object providing method “get_ahk” 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 “get_ahk” method. In this case Router forwards the objects to relevant Matcher.
The Matcher is likely to have many Data objects with the same AHK and needs a way to rank and filter results, based on voluntary fields.
The Matcher uses method “proximity” of Attraction object on each matching Data 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 Attractor with objects filter “BabySitter” with mandatory (geolocation) and voluntary (gender, “min age”, “max age”, availability hours and budget per hour might) fields.
The Attractor 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 Attractor 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 Attractor Object is exported and hits Router, that uses method “get_ahk” to get AHK. The object is then forwarded it to corresponding Matcher node.
A girl publishes Object of kind “BabySitter” with AHK fields: gender, geolocation. Voluntary fields are age, availability hours and minimum payment per hour.
The Object is exported and hits her Router, that uses “get_ahk” to find appropriate Matcher node.
Matcher node sees Attractor and matching BabySitter objects, uses “proximity” method to create list of candidates, ordered by proximity score, to be sent back to the Parent's realm (via his Router node).
Once on Parent's node, the “Found” callback method is called. It might get list of “Visible” candidate objects and decide what to do about them (create results popup notification or show results).