Skip to content

A convenient way in order to exchange array data easily via processes or remote nodes. Inspired and adopted partly from Julia’s InterProcessCommunications WrappedArray

License

Notifications You must be signed in to change notification settings

wea-developers/wea.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wea.jl

What is wea?

Giving the package a meaning - wea stands for Wrapped Exchange Array. If you want to share array-packed data with different processes, remote nodes or different language executables ( yes, that's the vision ), wea is aiming to be a lean, lightweight and convenient alternative to Protocol Buffers and Co.

It's inspired and adopted from Julia’s InterProcessCommunication WrappedArray in collaboration with @emmt.

If this sounds good to you, just give it a try.

Getting started

Install the package directly via

pkg> add https://github.com/casabre/wea.jl

until it is going to be registered.

Quick API guide

If you want to use a plain WrappedExchangeArray, just try

using wea

id = "/shm-id";
T = Float64;
dims = (10, 2);

wa = WrappedExchangeArray(id, T, dims);
wa[:] = ones(T, dims);

in order to create a shared memory segment.

Convenience functions

You can store any memory element within the Wrapped Exchange arrays. In order to reduce the setup hustle, you can utilize the following convenience modules.

Shared Exchange Array

In order to create a new shared memory segment, use the following snippet

using wea

key = "/shm-id";
T = Float64;
dims = (10, 2);

A = wea.SharedExchangeArray.create(key, T, dims)
A[:] = ones(T, dims)
id = wea.shmid(A)
B = wea.SharedExchangeArray.load(id; readonly=true)

Buffered Exchange Array

In order to share byte data via your favorite exchange protocol, you can use the following snippet.

using wea

T = Float32
dims = (3, 4, 5)
A = wea.BufferedExchangeArray.create(T, dims)
A[:] = ones(T, dims)
buf = wea.BufferedExchangeArray.get_exchange_buffer(A)
B = wea.BufferedExchangeArray.load(buf)

Contributing

I welcome any contributions, enhancements, and bug-fixes. Open an issue on GitHub and submit a pull request.

License

wea.py is 100% free and open-source, under the MIT license. Use it however you want.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

About

A convenient way in order to exchange array data easily via processes or remote nodes. Inspired and adopted partly from Julia’s InterProcessCommunications WrappedArray

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages