Coder Social home page Coder Social logo

biome's People

Contributors

parkan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

biome's Issues

Listening to new events?

Is there a way to make an event listener for each new event? getEvents seems like we'd have to poll it.

biome.getEvents() returns empty list if run before an addEvent() call

biome.getEvents() returns empty list if run before an addEvent() call

Example code I'm using:

var Biome = require('biome')

class gardenBiome {
  constructor() {
  }

  async init() {
    var self = this;
    self.biome = Biome()
    await self.biome.start()
    self.biome.on('state changed', () => {
      console.log("state changeed!");
    });
  }

  async addEvent() {
    var self = this;
    var current_time = new Date().getTime();
    await self.biome.addEvent({ from: { "name": "dan" }, type: "seed", msg: "wow here's the current timestamp: " + current_time })
  }

  getEvents() {
    return this.biome.getEvents()
  } 
}

var gb = new gardenBiome();

gb.init()
//  .then(() => {
//    gb.addEvent()
//  })
  .then(() => {
    console.log(gb.getEvents());
  });

Biome can't run more than one instance on the same computer

I get this error:

events.js:182
      throw er; // Unhandled 'error' event
      ^

Error: file /Users/provolot/.jsipfs/repo.lock already locked
    at getStatus (/Users/provolot/github/distributed-gardens/viz/node_modules/lock-me/src/portable.js:55:25)
    at waterfall (/Users/provolot/github/distributed-gardens/viz/node_modules/lock-me/src/portable.js:100:5)
    at /Users/provolot/github/distributed-gardens/viz/node_modules/async/internal/once.js:12:16
    at next (/Users/provolot/github/distributed-gardens/viz/node_modules/async/waterfall.js:21:29)
    at /Users/provolot/github/distributed-gardens/viz/node_modules/async/internal/onlyOnce.js:12:16
    at nodeify (/Users/provolot/github/distributed-gardens/viz/node_modules/lock-me/src/portable.js:92:9)
    at Immediate._onImmediate (/Users/provolot/github/distributed-gardens/viz/node_modules/nodeify/index.js:15:9)
    at runCallback (timers.js:781:20)
    at tryOnImmediate (timers.js:743:5)
    at processImmediate [as _immediateCallback] (timers.js:714:5)

Here's the code I'm using:
https://github.com/cybernetics-conference/distributed-gardens/blob/master/viz/biomeTest.js

Browser and Node data is different

Right now, in the browser, getEvents has 18 events, and when run with node, getEvents has 124 events. Is there a reason for this discrepancy?

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.