![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
======================================
.. image:: https://readthedocs.org/projects/attentive/badge/?version=latest :target: http://attentive.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://github.com/sthysel/attentive/blob/master/docs/attentive.jpg?raw=true
.. code:: python
from attentive import StoppableThread, quit
from random import randint
class Man(StoppableThread):
def __init__(self, name):
StoppableThread.__init__(self)
self.name = name
def run(self):
print('{} has quickened'.format(self.name))
while not self.stopped:
self.sleep(randint(1, 10))
print('{} throws a {}'.format(self.name, randint(1, 6)))
print('{} expires'.format(self.name))
with Man('Trump'), Man('Wang'), Man('Erdoğan'):
while not quit.is_set():
quit.wait(1)
Example Run
.. code:: bash
🚼Trump has quickened
🚼Wang has quickened
🚼Erdoğan has quickened
Wang throws a ☣
Trump throws a ☢
Erdoğan throws a ☣
Wang throws a ☣
Wang throws a ☣
Erdoğan throws a 🍭
Erdoğan throws a ☣
Trump throws a ☣
^CErdoğan throws a 🍼
☠ Erdoğan expires
Wang throws a ☣
☠ Wang expires
Trump throws a 🍼
☠ Trump expires
Use attentive
if you need to wire up a some worker threads that needs to cleanly
shut themselves down on a SIG_INT or SIG_TERM.
StoppableThread
is a context managed thread that lives on while in context. Once it exists
context it sets its internal stopped flag that are periodically checked for state. This signals
thread state allowing the thread to cleanly exit.
External state is controlled by a signal event, exiting the main context loop.
Internally use the StoppableThread.sleep() method that is interrupted when stop()ed during sleep.
Install from pypi
.. code::
$ pip install attentive
Install from source
.. code::
$ pip install .
Current version is 0.1.5
FAQs
Stoppable thread with common stop signalling
We found that attentive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.