Sha256: 669e6c3ef48259e3a45c10cf8868e7a023984a4d35e8e4fbace07ac1fdac1cb4

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

module Pione
  module Front
    module TaskWorkerOwner
      attr_reader :task_worker_fronts
      attr_reader :task_worker_front_connection_id

      def get_tuple_space_server
        raise NotImplementedError
      end

      def add_task_worker_front(task_worker_front, connection_id)
        @task_worker_fronts << task_worker_front
        @task_worker_front_connection_id << connection_id
      end

      def remove_task_worker_front(task_worker_front, connection_id)
        @task_worker_fronts.delete(task_worker_front)
        @task_worker_front_connection_id.delete(connection_id)
      end

      def terminate
        terminate_task_worker_fronts
        super
      end

      private

      def initialize_task_worker_owner
        @task_worker_fronts = []
        @task_worker_front_connection_id = []
      end

      def terminate_task_worker_fronts
        @task_worker_fronts.each do |front|
          begin
            front.terminate
          rescue
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pione-0.2.2 lib/pione/front/task-worker-owner.rb
pione-0.2.1 lib/pione/front/task-worker-owner.rb
pione-0.2.0 lib/pione/front/task-worker-owner.rb
pione-0.1.4 lib/pione/front/task-worker-owner.rb
pione-0.1.3 lib/pione/front/task-worker-owner.rb
pione-0.1.2 lib/pione/front/task-worker-owner.rb