lightblue-platform / lightblue-migrator

GNU General Public License v3.0
3 stars 13 forks source link

add isEmpty check #331

Closed dcrissman closed 8 years ago

dcrissman commented 8 years ago

Add the ability to check if the something is currently in the shared store.

paterczm commented 8 years ago

@dcrissman, what is it for?

dcrissman commented 8 years ago

I have a situation where a method is being called and it is indeterminate if the sharedStore has already been set. My plan was to pop if an object existed or create a new object and re/push at the end, but it appears that a SharedStoreException is thrown if nothing is there. It would be nice to simple ask if the cache has already been set.

paterczm commented 8 years ago

You mean it's indeterminate if the object in sharedStore was already set? Set parallel=false on the facaded api to ensure this is the case. Parallel=true processing makes sense only when api does not relay on the sharedStore.

dcrissman commented 8 years ago

parallel is set to false, that isn't the issue. The issue is I have one facade method that calls another facade method. So the second method wouldn't know if the sharedStore has already been set or not. This new method would provide a means for the second method to check if a cache already exist as opposed to overriding it.

dcrissman commented 8 years ago

@paterczm - What is your opposition to having a method to test if the cache contains something or not?

dcrissman commented 8 years ago

Per discussion offline, will close this PR and go a different direction.