Added terminal action to routing lib.

Review: https://reviews.apache.org/r/22310