Comments (13)
I think the registries should probably be actors. Now that celluloid/celluloid#287 is landed and the inheritance anomalies have been eliminated, perhaps registries should descend from an abstract base class that includes Celluloid by default.
from dcell.
What about a delete method like I did here https://github.com/parcydo/dcell/commit/efdda59ddb90859a88516704f3b861eff7664d30, it's pretty much related to #6
A TTL is one way to solve this but I do it right now different and this requires a delete in the registry.
node = DCell::Node[:foo]
dispatched = false
after(2) do
unless dispatched
Logger.warn "Delete node #{node.inspect}"
node.delete
end
end
dispatched = node[:bar].baz
from dcell.
In the floss
impl, the registry backends are actors.
I don't think we should have these actors as Cells, but perhaps we can wait for my celluloid/celluloid#291 PR.
from dcell.
@halorgium why not?
from dcell.
@tarcieri dunno, was a thought. the RPC overhead especially for the floss
project means double-accounting.
from dcell.
"Overhead" was my original motivation for designing the API the way it was. Fuck that. Make everything an actor FTW ;)
from dcell.
Haha! Good call.
@aflatter would you feel OK spiking out an impl which used actors?
I'm not sure how the bootup process would look like.
from dcell.
I should probably expound: lots of cases cropped up where the registry being an actor was advantageous. The most notable was Zookeeper where an actor could keep a local cache which Zookeeper could actively invalidate and replace with new values. Saving a network trip while still receiving push updates in realtime is a huge win
from dcell.
@tarcieri, @halorgium: I think the overhead is negligible for now. DCell::Registry::Base
already is an actor: aflatter@b51d622#L2R2
@Neonlex I don't really like exposing such functionality. The Node#delete
method removes a node from the directory, thus making it inaccessible for all other nodes too. DCell should handle node unavailability in a deterministic way, maybe using distributed concensus.
from dcell.
@tarcieri @aflatter @halorgium zeromq(czmq) can soonish be used to handle all registry needs, https://github.com/zeromq/czmq/blob/master/src/zgossip.c#L442 might be of interest.
Have also written a ruby ffi wrapper for czmq, here is a gossip example: https://github.com/Asmod4n/ruby-ffi-czmq/blob/master/examples/gossip.rb
from dcell.
Cool!
from dcell.
I've cleaned up a bit the Registry API in pull request #91
Though, as @tarcieri I have doubts whether those should be actors. I noticed a quite noticeable overhead in my stress testing.
Probably a particular implementation should be an actor if registry BE library can't handle asynchronous requests. Mainly DCell does read access so I don't see a good reason to serialize access.
from dcell.
No feedback means everybody satisfied with current registry API?
from dcell.
Related Issues (20)
- Cannot follow the configuration example, please help HOT 3
- 0.16.2 HOT 16
- unexpected zookeeper error when using DCell HOT 4
- Using it in forked / multithreaded env HOT 8
- `require 'dcell'` already throws `DCell::NotConfiguredError` at the end HOT 2
- Clear stale nodes HOT 10
- Make compatible with newest Celluloid version HOT 11
- Please note recommended version of zeromq library in your wiki HOT 5
- Setting the path for logging HOT 1
- Http gem needs to be updated for security reasons HOT 1
- registry: on node exit all nodes are cleared
- Remove redis from mandatory rspec requirements
- dcell node id is not unique
- dcell should not require precise port for incoming connection
- dcell 0.15 dependencies are not correct
- dcell needs a new maintainer HOT 11
- Thoughts about the future of dcell and celluloid-zmq HOT 37
- Implement Celluloid::Sync
- How to use DCell to connect the remote node and use the actor? HOT 4
- Unable to run spec on OSX with various MRI Rubies HOT 10
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.
from dcell.