10000 GitHub - ake-temp/rama-space-clojure: A pure clojure + rama implementation of the RamaSpace example in clojure
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A pure clojure + rama implementation of the RamaSpace example in clojure

Notifications You must be signed in to change notification settings

ake-temp/rama-space-clojure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RamaSpace example in Clojure

A pure clojure + rama implementation of the RamaSpace example from the Tying it all together example provided by Red Planet Labs for rama.

Running

I've used babashka to write the scripts for this repo.

To start a repl you can just run:

$ bb repl

To run the tests:

$ bb test

Notes

You can find tests in test/rama_space/module_test.clj.

I was able to use clojure maps and records without any extra configuration, even .subSource worked just fine.

I found it helpful to introduce a couple of helper functions which can be found in src/rama/*. Most of these are just simple wrappers dealing with java varargs.

In src/rama/core.clj are some more interesting ones.

fn->rama-function is a helper macro to wrap clojure functions to a form that rama can take. This doesn't always work though, for example I had to create a class KeywordizeKeys for Path.view, presumably for similar reasons that Depot/hashBy requires a class.

extract-map-fields is basically a copy of extractJavaFields from rama-helpers.

In src/rama_space/client.clj I made a client map which was convenient to use, but presuming .clusterPState and friends are cheap then it's probably not needed.

I found I was forced to create a type for Depot/hashBy as it takes either something that implements com.rpl.rama.impl.NativeRamaFunction1 (which we don't have access to) or a Class. It would be nice if we could just supply a function, but I assume this is something that needs to be transmitted on the wire.

About

A pure clojure + rama implementation of the RamaSpace example in clojure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0