# Thread Safe Signal
```text
Thread safe signal to generate and receive events
```
## Installation:
```bash
pip install pyrvsignal
```
## Example code:
```python
import time
from threading import Thread
from pyrvsignal import Signal
class MyThread(Thread):
started = Signal()
finished = Signal()
def __init__(self, target, args):
self.target = target
self.args = args
Thread.__init__(self)
def run(self) -> None:
self.started.emit()
self.target(*self.args)
self.finished.emit()
def do_my_work(details):
print(f"Doing work: {details}")
time.sleep(10)
def started_work():
print("Started work")
def finished_work():
print("Work finished")
thread = MyThread(target=do_my_work, args=("testing",))
thread.started.connect(started_work)
thread.finished.connect(finished_work)
thread.start()
```
## Contact
  If any suggestions mail to [ravikiranb36@gmail.com](mailto:admin@w3schools.io)
Raw data
{
"_id": null,
"home_page": "https://github.com/ravikiranb36/pyrvsignal.github.io.git",
"name": "pyrvsignal",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "pyrvsignal signal thread_safe",
"author": "Ravikirana B",
"author_email": "ravikiranb36@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/31/04/2e91a94ed0b24008ca5f8fd98fe6e3676e76a3beceecad6954eee928dd46/pyrvsignal-2023.8.1.tar.gz",
"platform": null,
"description": "# Thread Safe Signal\r\n```text\r\nThread safe signal to generate and receive events\r\n```\r\n\r\n## Installation:\r\n```bash\r\npip install pyrvsignal\r\n```\r\n\r\n## Example code:\r\n\r\n```python\r\nimport time\r\nfrom threading import Thread\r\nfrom pyrvsignal import Signal\r\n\r\n\r\nclass MyThread(Thread):\r\n started = Signal()\r\n finished = Signal()\r\n\r\n def __init__(self, target, args):\r\n self.target = target\r\n self.args = args\r\n Thread.__init__(self)\r\n\r\n def run(self) -> None:\r\n self.started.emit()\r\n self.target(*self.args)\r\n self.finished.emit()\r\n\r\n\r\ndef do_my_work(details):\r\n print(f\"Doing work: {details}\")\r\n time.sleep(10)\r\n\r\ndef started_work():\r\n print(\"Started work\")\r\n \r\ndef finished_work():\r\n print(\"Work finished\")\r\n\r\nthread = MyThread(target=do_my_work, args=(\"testing\",))\r\nthread.started.connect(started_work)\r\nthread.finished.connect(finished_work)\r\nthread.start()\r\n```\r\n\r\n## Contact\r\n  If any suggestions mail to [ravikiranb36@gmail.com](mailto:admin@w3schools.io)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Signal for Python",
"version": "2023.8.1",
"project_urls": {
"Homepage": "https://github.com/ravikiranb36/pyrvsignal.github.io.git"
},
"split_keywords": [
"pyrvsignal",
"signal",
"thread_safe"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31042e91a94ed0b24008ca5f8fd98fe6e3676e76a3beceecad6954eee928dd46",
"md5": "eb718e13a492340dc65f531705bb9396",
"sha256": "8626fda2c6df86af98c6d30f4f0d15a1b3ff08d4e1f7030b9d18d6e57c0eaff7"
},
"downloads": -1,
"filename": "pyrvsignal-2023.8.1.tar.gz",
"has_sig": false,
"md5_digest": "eb718e13a492340dc65f531705bb9396",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 2111,
"upload_time": "2023-08-19T10:08:23",
"upload_time_iso_8601": "2023-08-19T10:08:23.634463Z",
"url": "https://files.pythonhosted.org/packages/31/04/2e91a94ed0b24008ca5f8fd98fe6e3676e76a3beceecad6954eee928dd46/pyrvsignal-2023.8.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-19 10:08:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ravikiranb36",
"github_project": "pyrvsignal.github.io",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyrvsignal"
}