| 176 | |
| 177 | private: |
| 178 | void check() |
| 179 | { |
| 180 | Try<bool> exists = link::exists(link); |
| 181 | if (exists.isError()) { |
| 182 | promise.fail(exists.error()); |
| 183 | terminate(self()); |
| 184 | return; |
| 185 | } else if (!exists.get()) { |
| 186 | promise.set(Nothing()); |
| 187 | terminate(self()); |
| 188 | return; |
| 189 | } |
| 190 | |
| 191 | // Perform the check again. |
| 192 | delay(Milliseconds(100), self(), &Self::check); |
| 193 | } |
| 194 | |
| 195 | const string link; |
| 196 | Promise<Nothing> promise; |