Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'event.system.startup_done/shutdown' commands/events #24

Open
chros73 opened this issue Sep 26, 2018 · 0 comments
Open

Add 'event.system.startup_done/shutdown' commands/events #24

chros73 opened this issue Sep 26, 2018 · 0 comments

Comments

@chros73
Copy link
Owner

chros73 commented Sep 26, 2018

A. Add event.system.* commands:

  • event.system.startup_done : triggered when startup is done
    • e.g. after loading session files
    • it doesn't mean that processing all the downloads are finished at this point (e.g. event.download.resumed starts after this event)
  • event.system.shutdown : triggered when shutdown is started

B. Usage examples:

# COMMAND/EVENT: Return startup time (can be used to calculate uptime)
method.insert  = system.startup_time, value, 0
method.set_key = event.system.startup_done, !!set_startup_time, {(branch, ((not,((system.startup_time)))), ((system.startup_time.set, (system.time))) )}
# Display startup time at startup
method.set_key = event.system.startup_done, ~log,  ((print, "Startup time: ", ((system.startup_time)) ))
# Prevent command to fire up on 'event.view.*' event during startup
method.set_key = event.view.show, ~print_name,  {(branch, ((system.startup_time)), ((print, ((ui.current_view)))) )}

# COMMAND/EVENT: Return shutdown time
method.insert  = system.shutdown_time, value|private, 0
method.set_key = event.system.shutdown, !!set_shutdown_time, {(branch, ((not,((system.shutdown_time)))), ((system.shutdown_time.set, (system.time))) )}
# Display shutdown time at shutdown
method.set_key = event.system.shutdown, ~log, ((print, "Shutdown time: ", ((system.shutdown_time)) ))
# Prevent command to fire up on 'event.download.paused/closed' event during shutdown
method.set_key = event.download.paused, ~print_name,  {(branch, ((not,((system.shutdown_time)))), ((print, ((d.name)))) )}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant