GithubHelp home page GithubHelp logo

kjman678 / queue Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

Amazon Builder Library のキューバックログの回避の記事を読んで、pythonでQueの実装記事を参考にQue処理を試してみました。

Jupyter Notebook 100.00%
python que

queue's Introduction

queue

Amazon Builder Library のキューバックログの回避の記事を読んで、pythonでQueの実装記事を参考にQue処理を試してみました。

乗り越えられないキューバックログの回避 https://aws.amazon.com/jp/builders-library/avoiding-insurmountable-queue-backlogs/?did=ba_card&trk=ba_card
Pythonでキューイング処理 https://qiita.com/okuhiiro/items/7e4813d8f44a40e23938

class Queue(object): def init(self): self.queue_list = []

# enqueue 待ち行列に入れる、キューに入れる
def enqueue(self, value):
    self.queue_list.append(value)

# dequeue 待ち行列からはずす
def dequeue(self):
    try:
        # 先頭をとりだす
        value = self.queue_list.pop(0)
    except IndexError:
        value = None

    return value

queue = Queue()

queue.enqueue("a") queue.enqueue("b") queue.enqueue("c")

print(queue.dequeue()) # aを出力 print(queue.dequeue()) # bを出力 print(queue.dequeue()) # cを出力 print(queue.dequeue()) # None

queue's People

Contributors

kjman678 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.