How to use the pebble.concurrent.thread function in Pebble

To help you get started, we’ve selected a few Pebble examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github noxdafox / pebble / test / test_concurrent_thread.py View on Github external
@concurrent.thread(name='decorator_kwarg')
def name_keyword_decorated_and_argument(name='bar'):
    return (threading.current_thread().name, name)
github noxdafox / pebble / test / test_concurrent_thread.py View on Github external
@concurrent.thread(name='concurrent_thread_name')
def name_keyword_decorated():
    return threading.current_thread().name
github noxdafox / pebble / test / test_concurrent_thread.py View on Github external
@concurrent.thread(daemon=False)
def daemon_keyword_decorated():
    return threading.current_thread().daemon
github noxdafox / pebble / test / test_concurrent_thread.py View on Github external
    @concurrent.thread
    def instmethod(self):
        return self.b
github noxdafox / pebble / test / test_concurrent_thread.py View on Github external
@concurrent.thread
def error_decorated():
    raise RuntimeError("BOOM!")
github deepdiy / deepdiy / deepdiy / plugins / processing / predict / predict.py View on Github external
	@thread
	def load(self):
		if self.model.config_path!='':
			self.config=json.load(open(self.model.config_path))
		else:
			self.config={'CLASS_NAMES':['background','target']}
		with self.graph.as_default():
			self.model.load_network()
			self.model.load_weight()
			self.is_weight_loaded=True
			self.ids.btn_load_weight.text='Load Model'
github deepdiy / deepdiy / deepdiy / core / sandbox.py View on Github external
	@concurrent.thread
	def run(self):
		if not self.graph is None:
			with self.graph.as_default():
				if self.use_selected_data:
					input=self.data['selection']['data']['content']
					result=self.func(input,**self.kwargs)
				else:
					result=self.func(**self.kwargs)
		else:
			if self.use_selected_data:
				input=self.data['selection']['data']['content']
				result=self.func(input,**self.kwargs)
			else:
				result=self.func(**self.kwargs)
		return result
github deepdiy / deepdiy / deepdiy / core / plugin_mgr.py View on Github external
	@ thread # run in separate thread
	def collect_plugins(self):
		for name in self.plugin_package_names:
			plugin_wrapper=PluginWrapper(name)
			if plugin_wrapper.is_valid is True:
				plugin_wrapper.bind(is_disabled=self.on_plugin_disable_clicked)
				plugin_wrapper.bind(is_valid=self.on_plugin_validity_changed)
				plugin_wrapper.bind(instance=self.on_plugin_instance_changed)
				self.plugins[plugin_wrapper.id]={'type':plugin_wrapper.type,'disabled':False,'wrapper':plugin_wrapper,'instance':plugin_wrapper.instance}