8000 GitHub - moonlibs/package-reload: Module for unloading previously loaded modules · GitHub
[go: up one dir, main page]

Skip to content
{"props":{"color_mode":"dark","logged_in":false,"marketing_page":false,"home_path":"/","login_path":"/login?return_to=https%3A%2F%2FgitHub.com%2Fmoonlibs%2Fpackage-reload","signup_path":"/signup?ref_cta=Sign+up\u0026ref_loc=header+logged+out\u0026ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E\u0026source=header-repo\u0026source_repo=moonlibs%2Fpackage-reload","signup_enabled":true,"is_signup_controller":false,"show_search_and_nav":true,"hide_search":false,"private_mode_enabled":false,"should_use_dotcom_links":true,"auth_hydro_click":"{\"event_type\":\"authentication.click\",\"payload\":{\"location_in_page\":\"site header menu\",\"repository_id\":null,\"auth_type\":\"SIGN_UP\",\"originating_url\":\"https://gitHub.com/moonlibs/package-reload\",\"user_id\":null}}","auth_hydro_click_hmac":"e98b4ce618d5be95078a7a598ebbb96a31c3b92cf3444610b2e51f5eb52be1b4"}}

About

Module for unloading previously loaded modules

Resources

Stars

15 stars

Watchers

2 watching

Forks

 
 

Latest commit

 

History

18 Commits

Folders and files

Repository files navigation

Hot code reloader for Tarantool 1.6+

Overview

package.reload is a Lua package for hot-reloading Tarantool packages. It may come in handy if you have a large in-memory dataset and need to often deploy code changes.

How it works

When first loaded, package.reload lists all the currently loaded packages without reloading them:

tarantool> require('package.reload')
1st load. loaded: fiber, ffi, io, http.client.driver, console, digest, json, uri, jit.dis_x64, box.internal.gc, crypto, net.box, internal.argparse, jit.bcsave, jit.opt, uuid, fio, pwd, internal.trigger, jit.p, jit.vmdef, os, string, debug, jit.profile, socket, tap, coroutine, net.box.lib, jit.dump, pickle, msgpack, jit.dis_x86, box.backup, jit, jit.v, buffer, box, yaml, xlog, errno, bit, box.internal, jit.zone, package, msgpackffi, csv, jit.bc, help.en_US, title, box.internal.session, tarantool, strict, fun, table.new, math, help, table.clear, _G, http.client, jit.util, log, table, clock, iconv
---
...

On subsequent calls, package.reload reloads all the packages that have been loaded since the previous call to package.reload. Suppose you have loaded three packages: avro_schema, expirationd, and memcached. Then after calling package.reload you should see a similar output:

tarantool> package.reload()
2nd load. Unloading {memcached, expirationd, avro_schema.compiler, avro_schema.runtime, avro_schema.il, avro_schema, avro_schema.backend, avro_schema.frontend}
reload:cleanup...
reload:cleanup finished
---
...

About

Module for unloading previously loaded modules

Resources

Stars

15 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages

0