Permalink
Browse files

WIP

  • Loading branch information...
1 parent 9f861bb commit 656581eeff98154256967cd1ee222609a29ac5ad @burke committed Aug 24, 2012
Showing with 142 additions and 2,845 deletions.
  1. +1 −0 .gitignore
  2. +0 −5 .travis.yml
  3. +0 −11 .zeus.rb
  4. +0 −8 Gemfile
  5. +2 −1 MIT-LICENSE
  6. +7 −0 Makefile
  7. +0 −15 Rakefile
  8. +8 −0 a.rb
  9. +0 −8 bin/zeus
  10. +7 −0 cmd/zeus/Makefile
  11. +10 −0 cmd/zeus/zeus.go
  12. +0 −14 docs/acceptor_registration.md
  13. +0 −25 docs/client_server_handshake.md
  14. +0 −246 ext/fsevents-wrapper.xcodeproj/project.pbxproj
  15. +0 −7 ext/fsevents-wrapper.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  16. BIN ...wrapper.xcodeproj/project.xcworkspace/xcuserdata/burke.xcuserdatad/UserInterfaceState.xcuserstate
  17. +0 −5 ext/fsevents-wrapper.xcodeproj/xcuserdata/burke.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
  18. +0 −86 ext/fsevents-wrapper.xcodeproj/xcuserdata/burke.xcuserdatad/xcschemes/fsevents-wrapper 2.xcscheme
  19. +0 −86 ext/fsevents-wrapper.xcodeproj/xcuserdata/burke.xcuserdatad/xcschemes/fsevents-wrapper.xcscheme
  20. +0 −27 ext/fsevents-wrapper.xcodeproj/xcuserdata/burke.xcuserdatad/xcschemes/xcschememanagement.plist
  21. BIN ext/fsevents-wrapper/fsevents-wrapper
  22. +0 −118 ext/fsevents-wrapper/main.m
  23. +0 −97 lib/thrud.rb
  24. +0 −47 lib/zeus.rb
  25. +0 −80 lib/zeus/cli.rb
  26. +0 −114 lib/zeus/client.rb
  27. +0 −28 lib/zeus/client/winsize.rb
  28. +0 −16 lib/zeus/error_printer.rb
  29. +0 −18 lib/zeus/plan.rb
  30. +0 −38 lib/zeus/plan/acceptor.rb
  31. +0 −66 lib/zeus/plan/node.rb
  32. +0 −50 lib/zeus/plan/stage.rb
  33. +0 −104 lib/zeus/server.rb
  34. +0 −82 lib/zeus/server/acceptor.rb
  35. +0 −75 lib/zeus/server/acceptor_registration_monitor.rb
  36. +0 −36 lib/zeus/server/at_exit_hack.rb
  37. +0 −106 lib/zeus/server/client_handler.rb
  38. +0 −84 lib/zeus/server/command_runner.rb
  39. +0 −8 lib/zeus/server/file_monitor.rb
  40. +0 −102 lib/zeus/server/file_monitor/fsevent.rb
  41. +0 −40 lib/zeus/server/load_tracking.rb
  42. +0 −89 lib/zeus/server/process_tree_monitor.rb
  43. +0 −88 lib/zeus/server/stage.rb
  44. +0 −42 lib/zeus/server/stage/error_state.rb
  45. +0 −38 lib/zeus/server/stage/feature_notifier.rb
  46. +0 −132 lib/zeus/templates/rails.rb
  47. +0 −57 lib/zeus/ui.rb
  48. +0 −3 lib/zeus/version.rb
  49. +0 −95 spec/cli_spec.rb
  50. +0 −27 spec/error_printer_spec.rb
  51. +0 −106 spec/integration_spec.rb
  52. +0 −88 spec/server/file_monitor/fsevent_spec.rb
  53. +0 −67 spec/server/load_tracking_spec.rb
  54. +0 −50 spec/server/process_tree_monitor_spec.rb
  55. +0 −38 spec/spec_helper.rb
  56. +0 −54 spec/ui_spec.rb
  57. +0 −18 zeus.gemspec
  58. +107 −0 zeus/zeus.go
View
@@ -15,3 +15,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
+cmd/zeus/zeus
View
@@ -1,5 +0,0 @@
-language: ruby
-rvm:
- - 1.9.3
- - 1.9.2
-
View
@@ -1,11 +0,0 @@
-Zeus::Server.define! do
-
- stage :zeus do
- action { require 'zeus' ; require 'rspec' ; require 'rspec/core/runner' }
-
- command :spec, :s do
- RSpec::Core::Runner.autorun
- end
- end
-
-end
View
@@ -1,8 +0,0 @@
-source 'https://rubygems.org'
-
-# Specify your gem's dependencies in zeus.gemspec
-gemspec
-
-gem 'rspec'
-gem 'rake'
-gem 'pry'
View
@@ -19,4 +19,5 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
View
@@ -0,0 +1,7 @@
+MAKEFLAGS = -s
+
+all:
+ cd cmd/zeus; $(MAKE)
+
+clean:
+ cd cmd/zeus; $(MAKE) clean
View
@@ -1,15 +0,0 @@
-#!/usr/bin/env rake
-require "bundler/gem_tasks"
-
-require 'rspec/core/rake_task'
-task :spec do
- desc "Run specs under spec/"
- RSpec::Core::RakeTask.new do |t|
- t.pattern = 'spec/**/*_spec.rb'
- end
-end
-
-task :default do
- puts "rake fails when run via bundle exec"
- Rake::Task["spec"].invoke
-end
View
8 a.rb
@@ -0,0 +1,8 @@
+require 'socket'
+
+fd = ENV['ZEUS_MASTER_FD'].to_i
+a,b = UNIXSocket.pair
+sock = UNIXSocket.for_fd(fd)
+sock.send_io(a)
+b << "Hello from ruby!"
+b.close
View
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-
-if defined?(Bundler)
- puts "\x1b[34mDon't run Zeus with `bundle exec`. It's unnecessarily slow.\x1b[0m"
-end
-
-require 'zeus'
-Zeus::CLI.start
View
@@ -0,0 +1,7 @@
+MAKEFLAGS = -s
+
+all:
+ go build
+
+clean:
+ go clean
View
@@ -0,0 +1,10 @@
+package main
+
+import (
+ "github.com/burke/zeus/zeus"
+ "fmt"
+)
+
+func main () {
+ fmt.Println(zeus.Run())
+}
@@ -1,14 +0,0 @@
-# Acceptor Registration
-
-When an acceptor is booted, it registers itself with the master process through UNIX Sockets. Specifically, it talks to the `AcceptorRegistrationMonitor`.
-
-Here's an overview of the registration process:
-
-1. `AcceptorRegistrationMonitor` creates a socketpair for Acceptor registration (`S_REG`)
-2. When an `Acceptor` is started, it:
- 1. Creates a new socketpair for communication with the master process (`S_ACC`)
- 2. Sends one side of `S_ACC` over `S_REG` to the master.
- 3. Sends its pid and then a newline character over `S_REG`.
-3. `AcceptorRegistrationMonitor` receives first the IO and then the pid, and stores them for later reference.
-
-
@@ -1,25 +0,0 @@
-# Client/Server handshake
-
-This takes place in `lib/zeus/server/client_handler.rb`, `lib/zeus/client.rb`, and `lib/zeus/server/acceptor.rb`.
-
-The model is kind of convoluted, so here's an explanation of what's happening with all these sockets:
-
-## Running a command
-1. ClientHandler has a UNIXServer (`SVR`) listening.
-2. ClientHandler has a socketpair with the acceptor referenced by the command (see `docs/acceptor_registration.md`) (`S_ACC`)
-3. When clienthandler receives a connection (`S_CLI`) on `SVR`:
- 1. ClientHandler sends `S_CLI` over `S_ACC`, so the acceptor can communicate with the server's client.
- 2. ClientHandler sends a JSON-encoded array of `arguments` over `S_ACC`
- 3. Acceptor sends the newly-forked worker PID over `S_ACC` to clienthandler.
- 4. ClientHandler forwards the pid to the client over `S_CLI`.
-
-
-## A sort of network diagram
- client clienthandler acceptor
- 1 ----------> | {command: String, arguments: [String]}
- 2 ----------> | Terminal IO
- 3 -----------> | Terminal IO
- 4 -----------> | Arguments (json array)
- 5 <----------- | pid
- 6 <--------- | pid
-
@@ -1,246 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 8280E8D615C7303000CDF59C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 8280E8D515C7303000CDF59C /* main.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
- 82DC011D15C6EE760098E42A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82DC011C15C6EE760098E42A /* Foundation.framework */; };
- 82DC012B15C6F2620098E42A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82DC012A15C6F2620098E42A /* CoreServices.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 82DC011615C6EE760098E42A /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 8280E8D515C7303000CDF59C /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 82DC011815C6EE760098E42A /* fsevents-wrapper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "fsevents-wrapper"; sourceTree = BUILT_PRODUCTS_DIR; };
- 82DC011C15C6EE760098E42A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 82DC012215C6EE760098E42A /* fsevents-wrapper-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "fsevents-wrapper-Prefix.pch"; sourceTree = "<group>"; };
- 82DC012A15C6F2620098E42A /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 82DC011515C6EE760098E42A /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 82DC012B15C6F2620098E42A /* CoreServices.framework in Frameworks */,
- 82DC011D15C6EE760098E42A /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 82DC010D15C6EE760098E42A = {
- isa = PBXGroup;
- children = (
- 82DC011E15C6EE760098E42A /* fsevents-wrapper */,
- 82DC011B15C6EE760098E42A /* Frameworks */,
- 82DC011915C6EE760098E42A /* Products */,
- );
- sourceTree = "<group>";
- };
- 82DC011915C6EE760098E42A /* Products */ = {
- isa = PBXGroup;
- children = (
- 82DC011815C6EE760098E42A /* fsevents-wrapper */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 82DC011B15C6EE760098E42A /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 82DC012A15C6F2620098E42A /* CoreServices.framework */,
- 82DC011C15C6EE760098E42A /* Foundation.framework */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- 82DC011E15C6EE760098E42A /* fsevents-wrapper */ = {
- isa = PBXGroup;
- children = (
- 8280E8D515C7303000CDF59C /* main.m */,
- 82DC012115C6EE760098E42A /* Supporting Files */,
- );
- path = "fsevents-wrapper";
- sourceTree = "<group>";
- };
- 82DC012115C6EE760098E42A /* Supporting Files */ = {
- isa = PBXGroup;
- children = (
- 82DC012215C6EE760098E42A /* fsevents-wrapper-Prefix.pch */,
- );
- name = "Supporting Files";
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 82DC011715C6EE760098E42A /* fsevents-wrapper */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 82DC012715C6EE760098E42A /* Build configuration list for PBXNativeTarget "fsevents-wrapper" */;
- buildPhases = (
- 82DC011415C6EE760098E42A /* Sources */,
- 82DC011515C6EE760098E42A /* Frameworks */,
- 82DC011615C6EE760098E42A /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "fsevents-wrapper";
- productName = "fsevents-wrapper";
- productReference = 82DC011815C6EE760098E42A /* fsevents-wrapper */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 82DC010F15C6EE760098E42A /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0440;
- ORGANIZATIONNAME = "Burke Libbey";
- };
- buildConfigurationList = 82DC011215C6EE760098E42A /* Build configuration list for PBXProject "fsevents-wrapper" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 0;
- knownRegions = (
- en,
- );
- mainGroup = 82DC010D15C6EE760098E42A;
- productRefGroup = 82DC011915C6EE760098E42A /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 82DC011715C6EE760098E42A /* fsevents-wrapper */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 82DC011415C6EE760098E42A /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8280E8D615C7303000CDF59C /* main.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 82DC012515C6EE760098E42A /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = NO;
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PREPROCESSOR_DEFINITIONS = (
- "DEBUG=1",
- "$(inherited)",
- );
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx10.7;
- };
- name = Debug;
- };
- 82DC012615C6EE760098E42A /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
- CLANG_ENABLE_OBJC_ARC = YES;
- CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.7;
- SDKROOT = macosx10.7;
- };
- name = Release;
- };
- 82DC012815C6EE760098E42A /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- ONLY_ACTIVE_ARCH = NO;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx10.7;
- };
- name = Debug;
- };
- 82DC012915C6EE760098E42A /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = "";
- ONLY_ACTIVE_ARCH = NO;
- PRODUCT_NAME = "$(TARGET_NAME)";
- SDKROOT = macosx10.7;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 82DC011215C6EE760098E42A /* Build configuration list for PBXProject "fsevents-wrapper" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 82DC012515C6EE760098E42A /* Debug */,
- 82DC012615C6EE760098E42A /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 82DC012715C6EE760098E42A /* Build configuration list for PBXNativeTarget "fsevents-wrapper" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 82DC012815C6EE760098E42A /* Debug */,
- 82DC012915C6EE760098E42A /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 82DC010F15C6EE760098E42A /* Project object */;
-}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 656581e

Please sign in to comment.