Open bwgjoseph opened 3 years ago
We released Ottoman beta.9 today please verify
We have added watchIndexes, basically gives you ability to assign a callback where you can find when the indexes are built.
Is watchIndexes
something for developer to call? I can't seem to find the docs for it, is it available already?
hi @bwgjoseph
in beta.9 we add an experimental layer for watchIndexes on Ottoman, but it will be ready in the new beta.10 released today or maybe tomorrow (September, 28th)
documentation preview picture:
watchIndexes from SDK will be handle like the Ottoman's event 'IndexOnline', like describe in the picture above
I'm confused about start
now that there's watchIndexes
. Doesn't start
also wait for indexes to be created?
Reading back the previous comments, it seem that it does not. In that case, would that means that I always require to wait for IndexOnline
event to happen before accepting traffic?
We are still working on it, but we implement it separately because the key-value operations will not require indexes. e.g. save, update, replace, findById
It's just a proposal, is very possible to change in the future, maybe the start
function includes it activate by an option flag. I will notify you about any change in this API.
Sure. I think allowing us to set the flag make sense if I want to defer it to let start
waits for the indexes to be ready rather than listening to the event myself. But having the event also allows me to have more flexibility if I need it.
This should be available with GA release please check it out @bwgjoseph
Is it the one with the ottoman.on('IndexOnline')
event or with the option flag to the start
method?
Based on the issue around #90, and #97, the common problem here is that the developer has no control over when the indexes are ready, and if it's not, the startup would throw an error.
This issue is to consolidate all other issues pertaining/relating to this to keep the issue list clean.
An extract of my comment in https://github.com/bwgjoseph/mongoose-vs-ottoman/issues/90#issuecomment-868328940