def service(self):        
        act_evt_map = self.local_endpoint._act_event_map

        try:
            act_event = act_evt_map.get_or_create_endpoint_called_event(
                self.endpoint_making_call,self.event_uuid,self.result_queue)
        except util.StoppedException:
            self.result_queue.put(
                waldoCallResults._StopAlreadyCalledEndpointCallResult())
            return
        
        import waldoVariableStore
        evt_ctx = waldoExecutingEvent._ExecutingEventContext(
            self.local_endpoint._global_var_store,
            # should not have any sequence local data from an endpoint
            # call.
            waldoVariableStore._VariableStore(
                self.local_endpoint._host_uuid) )
        # receiving endpoint must know that this call was an endpoint
        # call.  This is so that it can ensure to make deep copies of
        # all non-external arguments (including lists,maps, and user
        # structs).
        evt_ctx.set_from_endpoint_true()
        exec_event = waldoExecutingEvent._ExecutingEvent(
            self.to_exec,act_event,evt_ctx,self.result_queue,
            *self.args)

        # don't start as separte thread
        exec_event.run()
Example #2
0
    def _receive_endpoint_call(
        self,endpoint_making_call,event_uuid,func_name,result_queue,*args):
        '''
        For params, @see _EndpointServiceThread.endpoint_call
        
        Non-blocking.  Requests the endpoint_service_thread to perform
        the endpoint function call listed as func_name.
        '''
        self._stop_lock()
        # check if should short-circuit processing 
        if self._stop_called:
            result_queue.push(
                waldoCallResults._StopAlreadyCalledEndpointCallResult())
            self._stop_unlock()
            return
        self._stop_unlock()

        self._endpoint_service_thread_pool.receive_endpoint_call(
            endpoint_making_call,event_uuid,func_name,result_queue,*args)