|
In Sheerpower, symbolic value pairs provide a powerful mechanism for sharing and maintaining data across processes and reboots. These symbolic values are divided into three types: globals, symbols, and logicals. In this tutorial, we’ll explore each type, provide examples of their usage, suggest practical applications, and conclude with key takeaways.
Globals in Sheerpower persist as long as at least one Sheerpower process is running. Once all processes terminate, the globals are removed. Globals are extremely fast, capable of handling over 10 million reads and writes per second, making them perfect for rapid inter-process communication.
In this example, we set a global symbol current_session
with
the value "12345". We then retrieve that value and print it.
Symbols persist until the next system reboot, at which point they are cleared. They are useful when you need temporary data storage that lasts beyond a single process but doesn’t need to survive reboots.
Here, we set a symbolic value for the last backup date. We can ask for this value later, and it will persist until the machine reboots.
Logicals are the most persistent form of symbolic values. They survive reboots and can even be used to represent file paths or other constants that need to remain available system-wide.
In this example, we store a logical path for a project directory. This value persists across reboots, ensuring it's always available.
Sheerpower offers flexible symbolic value pairs that allow developers to store and share data efficiently:
By understanding the unique strengths of each symbolic type, you can ensure your Sheerpower applications are both robust and performant.
Hide Description
|
|
Enter or modify the code below, and then click on RUN |
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |