title: Singleton in Google Dataflow
body: <p>I have a dataflow which reads the messages from PubSub. I need to enrich this message using couple of API's. I want to have a single instance of this API to used for processing all records. This is to avoid initializing API for every request.</p>
  
  <p>I tried creating a static variable, but still I see the API is initialized many times. </p>
  
  <p>How to avoid initializing of a variable multiple times in Google Dataflow?</p>