When a person contracts for the performance of services by himself for a stipulated period of time and is prevented from full performance of the contract by sickness or death, he or his personal representative, as the case may be, may recover a ratable compensation for the service actually rendered, notwithstanding the entirety of the contract.