Sha256: 4de6bbfbe31227f2de1d2b982aa80d3ac017347f29cab778ee97e81300052df7

Contents?: true

Size: 1014 Bytes

Versions: 2

Compression:

Stored size: 1014 Bytes

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
      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

2 entries across 2 versions & 1 rubygems

Version Path
pione-0.1.1 lib/pione/front/task-worker-owner.rb
pione-0.1.0 lib/pione/front/task-worker-owner.rb