Skip to content

Commit

Permalink
Add black
Browse files Browse the repository at this point in the history
  • Loading branch information
awlx committed Sep 18, 2023
1 parent 6e35300 commit bceb4b7
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions wgkex/worker/msg_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
from queue import Queue
from wgkex.common import logger
from wgkex.worker.netlink import link_handler
from wgkex.worker.netlink import WireGuardClient

class UniqueQueue(Queue):
def put(self, item, block=True, timeout=None):
if item not in self.queue: # fix join bug
Queue.put(self, item, block, timeout)
def _init(self, maxsize):
self.queue = set()
def _put(self, item):
self.queue.add(item)
def _get(self):
return self.queue.pop()
from wgkex.worker.netlink import WireGuardClient


class UniqueQueue(Queue):
def put(self, item, block=True, timeout=None):
if item not in self.queue: # fix join bug
Queue.put(self, item, block, timeout)

def _init(self, maxsize):
self.queue = set()

def _put(self, item):
self.queue.add(item)

def _get(self):
return self.queue.pop()


q = UniqueQueue()
Expand Down

0 comments on commit bceb4b7

Please sign in to comment.