basic usage of promise

how to complete a promise, whether success of failure.