Git Product home page Git Product logo

roads-models's People

Contributors

dashron avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

roads-models's Issues

todo: parallel

add a "parallel" function, kinda like promises.

model1.load(id)
    .parallel(function () {
        return model2.load(id);
    })
    .ready(function (item1, item2) {

    })

I don't necessarily like the spec of he ready callback, code might be overly complex to achieve the correct order.

Predefine simple collections

Predefine simple collections so that we can auto cache update them.

UserModule.collections['all'] = 'select id from users';

default onSave updates the all collection.

Error callbacks should support promises

if (callback._error) {
callback._error(err);
}
else {
callback(err);
}

don't force users to use bind. it adds extra unnecessary computation. we can assume the _error pattern exists because we often will be chaining request promises

connection pooling

Look into the mysql pooling and....

http://archive.coreservlets.com/Chapter18.html

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=%2Frzaha%2Fpoolnods.htm

on getConnection()....

if connection[0] is connected and ready, perform request
if connection[0] is connected and not ready, if connection.length <
max_connections, create connection and perform request, otherwise
queue up request
if connection[0] is not connected, shift off array and attempt the new
connection[0]

add sort support

model.js: turns the sort into an order by statement

cachedmodel.js: uses an alternate cache key, which uses a sorted set
This sort stuff should be built into the buildCacheKey function so that onSave we can keep the sorted set up to date.
let mysql do the initial sorting for now.

Handle not null in the db definition

so that it goes through the validation handler and doesn't end up being a db error
it would be cool if we could also bubble mysql errors through the validation handler

add pagination support

model.js : should simply turn the pagination into a limit

cachedmodel.js: should be filtered at the locateModels level. Keep every id cached in the set, but filter down the data when you pull the full model data.

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.