/// <summary>
        /// Overload for users who ARE ALREADY USING <see cref="IConfirmableMessage"/> by the time the message
        /// is received by the <see cref="PersistenceSupervisor"/>.
        ///
        /// If a message is received by the <see cref="PersistenceSupervisor"/> without being decorated by <see cref="IConfirmableMessage"/>,
        /// under this configuration we will automatically package your message inside a <see cref="ConfirmableMessageEnvelope"/>.
        /// </summary>
        /// <param name="childPropsFactory"></param>
        /// <param name="childName"></param>
        /// <param name="reset"></param>
        /// <param name="finalStopMsg"></param>
        /// <param name="strategy"></param>
        /// <remarks>
        /// Read the manual. Seriously.
        /// </remarks>
        /// <returns></returns>
        public static Props PropsFor(Func <IActorRef, Props> childPropsFactory, string childName, IBackoffReset reset = null,
                                     Func <object, bool> finalStopMsg = null,
                                     SupervisorStrategy strategy      = null)
        {
            var config =
                new PersistenceSupervisionConfig(null, null, reset, finalStopMessage: finalStopMsg);

            return(Props.Create(() => new PersistenceSupervisor(childPropsFactory, childName, config,
                                                                strategy ?? Actor.SupervisorStrategy.StoppingStrategy)));
        }
        public static Props PropsFor(Func <object, long, IConfirmableMessage> makeConfirmable,
                                     Func <object, bool> isEvent,
                                     Props childProps, string childName, IBackoffReset reset = null, Func <object, bool> finalStopMsg = null,
                                     SupervisorStrategy strategy = null)
        {
            var config =
                new PersistenceSupervisionConfig(isEvent, makeConfirmable, reset, finalStopMessage: finalStopMsg);

            return(Props.Create(() => new PersistenceSupervisor(childProps, childName, config,
                                                                strategy ?? Actor.SupervisorStrategy.StoppingStrategy)));
        }
        public PersistenceSupervisor(Func <IActorRef, Props> childProps, string childName,
                                     IPersistenceSupervisionConfig config, SupervisorStrategy strategy = null)
        {
            ChildProps = childProps;
            ChildName  = childName;
            _config    = config;
            _strategy  = strategy ?? Actor.SupervisorStrategy.StoppingStrategy;

            // use built-in defaults if unavailable
            IsEvent = _config.IsEvent ?? PersistenceSupervisionConfig.DefaultIsEvent;
            MakeEventConfirmable = _config.MakeEventConfirmable ??
                                   PersistenceSupervisionConfig.DefaultMakeEventConfirmable(childName);
        }