The deposition of a notary public may be taken, whether a suit be pending or not, on ten (10) days' notice to the opposite party, if resident in the state, and forty (40) days' notice out of the state, to be read as evidence between the same parties in any suit then or afterward depending, should the notary die or leave the state before the trial.