biome's People
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.