Split Help > Performance > Can I block the Split SDK until it is completely ready?

Can I block the Split SDK until it is completely ready?

Split's 'block until ready' capability allows you to wait until the SDK is completely ready before sending it traffic.

When the SDK is instantiated, it kicks off background tasks to update an in-memory cache with small amounts of data fetched from Split servers. This process can take up to a few hundred milliseconds, depending on the size of data. While the SDK is in this intermediate state, if it is asked to evaluate which treatment to show to a customer for a specific Split, it may not have data necessary to run the evaluation. In this circumstance, the SDK does not fail, rather it returns The Control Treatment.

If you would rather wait to send traffic till the SDK is ready, you can do that by blocking until the SDK is ready. This is best done as part of the startup sequence of your application. Here is an example in Java:

Published June 1, 2017