How do you tell young children that a parent is dying?

My partner has secondary breast cancer and we've been told her treatment has stopped working. We have two children, aged 6 and 9. They know Mummy is poorly but not that she is going to die. I don't know how to have this conversation or when. Has anyone been through this, or found good resources for children?