folly::Observer
authorAndrii Grynenko <andrii@fb.com>
Wed, 17 Aug 2016 02:25:54 +0000 (19:25 -0700)
committerFacebook Github Bot 5 <facebook-github-bot-5-bot@fb.com>
Wed, 17 Aug 2016 02:38:28 +0000 (19:38 -0700)
commit2ed41baf00ad62d46c118c11f92303542e61e235
tree7b46545c7d41253212d158de688f30576a843d5b
parent034d1bd92c306d854a4acf92ebc9b3181a0bbded
folly::Observer

Summary:
This is a basic implementation of a new Observer API. I mostly see this being useful as a replacement for various configuration subscription APIs (Configerator, SMC etc.)

The library provides an Observer primitive. At any time user can take a Snapshot of data in the Observer (which is a view with the most recent version of the data). New Observer can be created by providing a generator functor. Such Observer mays depend on other Observers and its generator functor is re-run automatically every time, when at least one of the dependencies are updated. The implementation may also ignore intermediate updates and will only use the most recent version of other Observers, when re-computing Observer data.

Reviewed By: yfeldblum

Differential Revision: D3481231

fbshipit-source-id: 96c165f8081cff0141d5814ec2bc88adeb2e1e74
13 files changed:
folly/Makefile.am
folly/experimental/observer/Observable-inl.h [new file with mode: 0644]
folly/experimental/observer/Observable.h [new file with mode: 0644]
folly/experimental/observer/Observer-inl.h [new file with mode: 0644]
folly/experimental/observer/Observer.h [new file with mode: 0644]
folly/experimental/observer/SimpleObservable-inl.h [new file with mode: 0644]
folly/experimental/observer/SimpleObservable.h [new file with mode: 0644]
folly/experimental/observer/detail/Core.cpp [new file with mode: 0644]
folly/experimental/observer/detail/Core.h [new file with mode: 0644]
folly/experimental/observer/detail/Observer-pre.h [new file with mode: 0644]
folly/experimental/observer/detail/ObserverManager.cpp [new file with mode: 0644]
folly/experimental/observer/detail/ObserverManager.h [new file with mode: 0644]
folly/experimental/observer/test/ObserverTest.cpp [new file with mode: 0644]