add post: state pattern

Signed-off-by: Wei Jin <wjin.cn@gmail.com>