Merge: lib/popcorn: introduce tasks
This PR is based on #2436
## Popcorn threaded tasks
Tasks allow you to execute code in another thread than the app listening loop.
Useful when you want to run some tasks periodically.
Let's say you want to purge the `downloads/` directory of your app every hour:
~~~nit
class PurgeTask
super PopTask
var dir: String
redef fun main do
loop
dir.rmdir
3600.sleep
end
end
end
var app = new App
# Register a new task
app.register_task(new PurgeTask("downloads/"))
# Add your handlers
# app.use('/', new MyHandler)
# Run the tasks
app.run_tasks
# Start the app
app.listen("0.0.0.0", 3000)
~~~
Pull-Request: #2437
Reviewed-by: Jean Privat <jean@pryen.org>