Code Monkey home page Code Monkey logo

active_node's People

Contributors

aaronrenner avatar amitsuryavanshi avatar flyingmachine avatar gnapse avatar klobuczek avatar opencoderx avatar turboladen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

active_node's Issues

Connection Pooling

Would anyone be interested in connection pooling? If I'm understanding the Neo class correctly, each time Neo.db is called it creates a new connection. I've got connection pooling working in my branch, should I send a pull request?

https://github.com/chrisgogreen/active_node

I added some readme to my branch for using the connection pool.
I wrapped @db in an if else to check for a globally defined db connection.

module ActiveNode
  class Neo
    def self.db
     if defined? $db
     @db = $db
     else
     @db ||= Neography::Rest.new
     end
    end
  end
end

If you define $db when your application initializes you can use a configurable connection pool:

require 'connection_pool'
$db = ConnectionPool::Wrapper.new(size: 50, timeout: 15) { Neography::Rest.new }

I'm not sure if using a global is a good idea in this case, but it got me loading data much faster last night. Before I made this change my sidekiq workers were loading about 20 nodes per second(one node per job), right now they are loading about 100.

Maybe instead of checking if a global named $db is defined I could check if any instances of the ConnectionPool class exist?

How to create or update?

I'd like to be able to create_or_update? I see some code for it but I can't tell how to use it and I don't see it in the specs. Is anyone creating_or_update 'ing?

Support neo4j 1.9.*

Here for example, label is not existing on neo4j 1.9.* and so we are hiting exception cause the endpoint label is not existing.

Client Side

node = User.create! name: 'name' is hiting :

Neography::NeographyError: Neography::NeographyError
from /Users/kwent/.rvm/gems/ruby-2.1.2@down-node/gems/neography-     1.5.0/lib/neography/connection.rb:244:in `raise_errors'
from /Users/kwent/.rvm/gems/ruby-2.1.2@down-node/gems/neography-    1.5.0/lib/neography/connection.rb:217:in `handle_4xx_500_response'

Server Side

com.sun.jersey.api.NotFoundException: null for uri: http://localhost:7474/db/data/node/1/labels
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1470)
    at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)

Associated objects returned as Array

When you try to fetch nodes using association macros (i.e :has_many) it returns simple Array class instead of ActiveNode::Graph.
This way methods cannot be chained further (i.e :order, :includes etc).

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.