Code Monkey home page Code Monkey logo

rs-object-space's People

Contributors

tmt96 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

rs-object-space's Issues

Finalize Agent

Agent is our main method of providing simple multithreading. Each Agent should run on a separate thread & be tied to one ObjectSpace. Ideally, it should be a thin wrapper around ObjectSpace functionality.

Agent API is currently unfinished, mostly due to trouble specifying different associated types for Agent, AgentRange, and AgentKey. We should finalize before alpha preview.

Improve Performance

After #7 , performance regresses by about 30%. We want to investigate how to revert this performance regression

Naming

Currently the naming of the API is unclear (e.g: ObjectSpaceRange, ObjectSpaceKey,...) We should replace it with more descriptive naming (e.g: RangedLookupSpace)

Timeout for blocking `read` and `take`

Currently we have two versions for single object retrieval methods (read and take): one is non-blocking and returns Option<T> (try_read). The other is blocking until an object satisfying condition is found (read). We could add a third version that block until a timeout and returns Option<T> (e.g: read_timeout): if timeout elapsed and no object satisfying the condition is found we returns None

Add support for float key & range retrieval

Float in Rust does not implement PartialOrd, causing problems for implementing Range functions for TreeobjectSpace, which relies on BTreeMap. Converting float Range to Range<NotNaN<f64>> should solve the problem.

Investigating using `flatten` flag in `serde`

Currently upon storing objects TreeObjectSpace flattens the result Value from serde_json serialization to support field range & value lookup.

e.g: Given this struct

#[derive(Serialize, Deserialize)]
struct Pagination {
    limit: u64,
    offset: u64,
    total: u64,
}

#[derive(Serialize, Deserialize)]
struct Users {
    users: Vec<User>,
    pagination: Pagination,
}

The resulting Value resembles:

Value {
    "users": Value(Array),
    "pagination.limit": Value(Number),
    "pagination.offset": Value(Number),
    "pagination.total": Value(Number)
}

A recent release from serde includes a flatten flag. using the flag for Pagination gives:

    "users": Value(Array),
    "limit": Value(Number),
    "offset": Value(Number),
    "total": Value(Number)

We may investigate how we could use this flag to simplify our serialization process.

Questions:

  • What happens if a struct has two child struct, each as a field of the same name, i.e count?
  • How could we apply this flag for each field in a struct?

Support Enum

Currently TreeObjectSpace does not support Enum. As Enum is an integral part of Rust (e.g: Option, Result, etc), supporting for Enum is crucial.

This might require rethinking field name checking in Entry as different subtypes in an enum may contain different field names. Refer https://serde.rs/json.html for more information on how enum is represented in serde-json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.