A safe (i.e., side-effect free), state-full ManagedProcess API