Zenohex.Examples.Plugins.StorageBackendFs (Zenohex v0.6.1)

View Source

Example usage of the zenoh-plugin-storage-manager.

This example uses zenoh-backend-filesystem as the backend.

The plugin configuration file is located at test/support/fixtures/STORAGE_BACKEND_FS_CONFIG.json5. Please refer to STORAGE_BACKEND_FS_CONFIG.json5 for the configuration details.

If the plugin fails to load, make sure that the followings exist

  • libzenoh_backend_fs.so
  • libzenoh_plugin_storage_manager.so

under the search_dirs specified in the configuration. If they exist, verify that their versions are compatible with the zenoh version used by zenohex.

For the actual implementation, please refer to the following,

Example

iex> Zenohex.Examples.Plugins.StorageBackendFs.start_link []
{:ok, #PID<...>}
iex> Zenohex.put("demo/example/file_a", "data_a")
:ok
iex> Zenohex.put("demo/example/file_b", "data_b")
:ok
iex> Zenohex.get("demo/example/**", 100)
{:ok, [%Zenohex.Sample{}, %Zenohex.Sample{}]}

Summary

Functions

Starts Elixir.Zenohex.Examples.Plugins.StorageBackendFs.

Functions

start_link(args)

@spec start_link([]) :: GenServer.on_start()

Starts Elixir.Zenohex.Examples.Plugins.StorageBackendFs.