{"action":"opened","issue":{"url":"https://api.github.com/repos/cortexlang/cortex/issues/219","labels_url":"https://api.github.com/repos/cortexlang/cortex/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/cortexlang/cortex/issues/219/comments","events_url":"https://api.github.com/repos/cortexlang/cortex/issues/219/events","html_url":"https://github.com/cortexlang/cortex/issues/219","id":68004210,"number":219,"title":"Dependency algorithm must be able to run continuously","user":{"login":"SanderMertens","id":9919222,"avatar_url":"https://avatars.githubusercontent.com/u/9919222?v=3","gravatar_id":"","url":"https://api.github.com/users/SanderMertens","html_url":"https://github.com/SanderMertens","followers_url":"https://api.github.com/users/SanderMertens/followers","following_url":"https://api.github.com/users/SanderMertens/following{/other_user}","gists_url":"https://api.github.com/users/SanderMertens/gists{/gist_id}","starred_url":"https://api.github.com/users/SanderMertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SanderMertens/subscriptions","organizations_url":"https://api.github.com/users/SanderMertens/orgs","repos_url":"https://api.github.com/users/SanderMertens/repos","events_url":"https://api.github.com/users/SanderMertens/events{/privacy}","received_events_url":"https://api.github.com/users/SanderMertens/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cortexlang/cortex/labels/DataReplication","name":"DataReplication","color":"fad8c7"},{"url":"https://api.github.com/repos/cortexlang/cortex/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cortexlang/cortex/milestones/2","html_url":"https://github.com/cortexlang/cortex/milestones/Alpha%20release%200.2.0","labels_url":"https://api.github.com/repos/cortexlang/cortex/milestones/2/labels","id":880518,"number":2,"title":"Alpha release 0.2.0","description":"The focus of this release is stabilization and QA.\r\n\r\nNew development will include:\r\n * dynamic observer expressions (potentially introduce lambda functions)\r\n * implicit casting\r\n * improvements in compile-time type checking\r\n * an automated test framework\r\n * improved parser error reporting & verification","creator":{"login":"SanderMertens","id":9919222,"avatar_url":"https://avatars.githubusercontent.com/u/9919222?v=3","gravatar_id":"","url":"https://api.github.com/users/SanderMertens","html_url":"https://github.com/SanderMertens","followers_url":"https://api.github.com/users/SanderMertens/followers","following_url":"https://api.github.com/users/SanderMertens/following{/other_user}","gists_url":"https://api.github.com/users/SanderMertens/gists{/gist_id}","starred_url":"https://api.github.com/users/SanderMertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SanderMertens/subscriptions","organizations_url":"https://api.github.com/users/SanderMertens/orgs","repos_url":"https://api.github.com/users/SanderMertens/repos","events_url":"https://api.github.com/users/SanderMertens/events{/privacy}","received_events_url":"https://api.github.com/users/SanderMertens/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":20,"state":"open","created_at":"2014-11-25T22:01:50Z","updated_at":"2015-04-13T04:27:23Z","due_on":"2015-04-29T05:00:00Z","closed_at":null},"comments":0,"created_at":"2015-04-13T04:27:23Z","updated_at":"2015-04-13T04:27:23Z","closed_at":null,"body":"The current dependency algorithm is suited for scenario's that determine order based on a static, non changing set of objects. Because of new requirements with respect to data replication this behavior is not sufficient.\r\n\r\nConsider the following scenario, where there is a data store X, which is replicated to store Y in real time. store X contains one item a, which has a dependency on item b. However, item b is not in store X.\r\n\r\nA component called a 'replicator' will replicate data between X and Y. This replicator will have a dependency resolver so that objects are inserted in the right order. When Y receives an event for a, it cannot yet insert it into its own store.\r\n\r\nTherefore, the dependency administration for a must stay around until item b is created. This will allow item a to be inserted. The dependency resolver will therefore act as a 'gateway' for objects that can and cannot be inserted into the store.\r\n\r\nBesides invoking the walk multiple times, there are two other scenario's the dependency walk must be able to support, which is updates and deletes.\r\n\r\nImagine that in the above scenario, before b is inserted, the value of a is updated, and it now no longer depends on b but on c. That means the previous dependencies of a must be removed, and replaced with new dependencies.\r\n\r\nSimilarly, if a is deleted, all dependencies of a onto other objects must be deleted as well. Note that the reverse is not true, if other objects depended on a, these dependencies must still be stored.\r\n\r\nFor this purpose, a 'clean' call needs to be added to the dependency resolver that cleans dependencies of a particular item.\r\n"}}