Glyph on Nostr: like if this sort of code sounds familiar and painful: if self.process is None: ...
like if this sort of code sounds familiar and painful:
if self.process is None:
self.start()
if self.process.stopping:
self._restart_after_stop = True
self._run_after_restart = request
return
if self.queue is not None:
self.queue.append(request)
return
self.process.send_command(...)
then you could probably use Automat to make your life a lot easier
Published at
2024-08-18 02:12:57Event JSON
{
"id": "fcd2e852de5167edbcdb7e977f5662014a57397f4433324a7ae17a570c4bd5ca",
"pubkey": "bd385aa0b579765c6883c5b0eb17e8ae350c988c659510be1e8453557ee38784",
"created_at": 1723947177,
"kind": 1,
"tags": [
[
"e",
"1f5062b96b0d6058f893ab86510f4921171e3f7ebb9426e292f65a9e115826e6",
"wss://relay.mostr.pub",
"reply"
],
[
"proxy",
"https://mastodon.social/users/glyph/statuses/112980602246412020",
"activitypub"
]
],
"content": "like if this sort of code sounds familiar and painful:\n\nif self.process is None:\n self.start()\nif self.process.stopping:\n self._restart_after_stop = True\n self._run_after_restart = request\n return\nif self.queue is not None:\n self.queue.append(request)\n return\nself.process.send_command(...)\n\nthen you could probably use Automat to make your life a lot easier",
"sig": "5e8ee3cfde034a9a9ba1d499b86c0a8db1a9b2520b722190d9969f669c53dbc394d46af6ed2865ff051f64251a4a7cc281412fbe23ed321ca448a6b616bb1198"
}