Post 3 in a Series on Go In a previous blog post we looked at how to build an unbounded channel, where writes to the channel would never block. It was built on top of two unbuffered channels, a goroutine, a slice, and a couple of closures. Notably missing was a buffered channel. Buffered channels never have unlimited buffers. Proper use of a buffered channel means that you must handle the case whe
まず直列実行するプログラムを書く 1秒待つコマンド 2秒待つコマンド 3秒待つコマンド 上記を順番に実行していくプログラムを main.cr の中身を書く。 つまり、合計で6秒かかってしまう。 require "logger" log = Logger.new(STDOUT) log.info "started." # 1秒かかるコマンド log.info "sleep1 started." sleep 1 log.info "sleep1 finished." # 2秒かかるコマンド log.info "sleep2 started." sleep 2 log.info "sleep2 finished." # 3秒かかるコマンド log.info "sleep3 strated." sleep 3 log.info "sleep3 finished." log.info "all fi
On a recent Elixir project, I needed to test some asynchronous behaviour. Doing so led me to learn about the basics of special processes in OTP. Our project was using Phoenix Channels and had a need to keep track of all connected socket processes. We could have used the upcoming Phoenix presence feature, but we didn’t quite need all of its features. We settled on using a simple GenServer process t
All slide content and descriptions are owned by their creators.
Package time provides functionality for measuring and displaying time. The calendrical calculations always assume a Gregorian calendar, with no leap seconds. Monotonic Clocks ¶Operating systems provide both a “wall clock,” which is subject to changes for clock synchronization, and a “monotonic clock,” which is not. The general rule is that the wall clock is for telling time and the monotonic clock
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く