File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ import time
2+
3+ from featureflags .client import CfClient
4+ from featureflags .config import *
5+ from featureflags .evaluations .auth_target import Target
6+ from featureflags .util import log
7+
8+
9+ def main ():
10+ # Create a Feature Flag Client
11+ client = CfClient ("c9b3f14f-6336-4d23-83b4-73f29d1ebeeb" )
12+
13+ # Create a target (different targets can get different results based on rules that you add in the UI).
14+ target = Target (identifier = 'mytarget' , name = "FriendlyName" )
15+
16+ # Loop forever reporting the state of the flag. If there is an error the default value will be returned
17+ while True :
18+ result = client .bool_variation ('simpleboolflag' , target , False )
19+ log .info ("Flag variation %s" , result )
20+ time .sleep (10 )
21+
22+ close ()
23+
24+
25+ if __name__ == "__main__" :
26+ main ()
You can’t perform that action at this time.
0 commit comments