https://zknill.io/posts/patterns-for-building-realtime/?utm_source=tldrwebdev Patterns for building realtime featuresRealtime features make apps feel modern, collaborative, and up-to-date. The features predominantly require sharing changes triggered by one user to other users, as the changes are happening. This typically means your server needs to send data to some set ozknill.io์ค์๊ฐ ๊ธฐ๋ฅ์ ์ฑ์ ๋ ํ๋์ ..
Developer philosophy @ Things Of InterestAmazing as it may seem after all these years, there are still junior developers in the world. A few weeks ago at work we had a talk where senior developers (including me) were invited to spend around five minutes each talking about our personal software deqntm.org ๋ฏฟ๊ธฐ ์ด๋ ค์ธ ์๋ ์์ง๋ง, ์ค๋ ์๊ฐ์ด ์ง๋ ์ง๊ธ๋ ์ฌ์ ํ ์ฃผ๋์ด ๊ฐ๋ฐ์๋ ์กด์ฌํ๋ค.๋ช ์ฃผ ์ ํ์ฌ์์ ๋๋ฅผ ํฌํจํ ์๋์ด ๊ฐ๋ฐ์๋ค์ด ๋ชจ์ฌ ๊ฐ์์ ์ํํธ์จ์ด ๊ฐ๋ฐ ์ฒ ..
Prototype ํจํด๐ก ํด๋์ค์์ ์ธ์คํด์ค๋ฅผ ์์ฑํ๋ ๋์ ์ธ์คํด์ค๋ก๋ถํฐ ๋ค๋ฅธ ์ธ์คํด์ค๋ฅผ ์์ฑ์ข
๋ฅ๊ฐ ๋๋ฌด ๋ง์ ํด๋์ค๋ก ์ ๋ฆฌํ ์ ์๋ ๊ฒฝ์ฐ์ทจ๊ธํ ์ค๋ธ์ ํธ์ ์ข
๋ฅ๊ฐ ๋ง์์ ์์ค ํ์ผ์ ๋ง์ด ์์ฑํด์ผ ํ๋ ๊ฒฝ์ฐํด๋์ค๋ก๋ถํฐ ์ธ์คํด์ค ์์ฑ์ด ์ด๋ ค์ด ๊ฒฝ์ฐ๋ณต์กํ ๊ณผ์ ์ ๊ฑฐ์ณ ๋ง๋ค์ด์ง๋ ๊ฒ์ผ๋ก ํด๋์ค๋ก๋ถํฐ ๋ง๋ค๊ธฐ๊ฐ ๋งค์ฐ ์ด๋ ค์ด ๊ฒฝ์ฐ์ฌ์ฉ์ ์กฐ์์ผ๋ก ๋ง๋ค์ด์ง ์ธ์คํด์ค์ ๊ฐ์ ๊ฒ์ ๋ค์ ๋ง๋ค๊ณ ์ถ์ ๊ฒฝ์ฐโ
ํ์ฌ ๋ง๋ ์ธ์คํด์ค๋ฅผ ์ผ๋จ ์ ์ฅํด๋๊ณ ๋ง๋ค๊ณ ์ถ์ ๋ ์ด๋ฅผ ๋ณต์ฌํ์ฌ ์์ฑํ๋ ์์ํฌ์ ์์ฑํ๋ ์ธ์คํด์ค๋ฅผ ๋ถ๋ฆฌํ๊ณ ์ถ์ ๊ฒฝ์ฐ์ธ์คํด์ค๋ฅผ ์์ฑํ๋ ํ๋ ์์ํฌ๋ฅผ ํน์ ํด๋์ค์ ์์กดํ์ง ์๊ฒ ํ๊ณ ์ถ์ ๊ฒฝ์ฐโ
๋ฏธ๋ฆฌ ์ํ์ด ๋ ์ธ์คํด์ค๋ฅผ ๋ฑ๋กํด๋๊ณ , ๋ฑ๋ก๋ ์ธ์คํด์ค๋ฅผ ๋ณต์ฌํ์ฌ ์์ฑ Prototype(์ํ)์ธ์คํด์ค๋ฅผ ๋ณต์ฌํ์ฌ ..
`CoroutineContext` : ์ฝ๋ฃจํด์ ์คํํ๋ ์คํ ํ๊ฒฝ์ ์ค์ ํ๊ณ ๊ด๋ฆฌํ๋ ์ธํฐํ์ด์คCoroutine Context ๊ตฌ์ฑ ์์`CoroutineName` : ์ฝ๋ฃจํด ์ด๋ฆ ์ค์ `CoroutineDispatcher` : ์ฝ๋ฃจํด์ ์ค๋ ๋์ ํ ๋นํด ์คํ`Job`: ์ฝ๋ฃจํด์ ์ถ์์ฒด๋ก ์ฝ๋ฃจํด์ ์กฐ์`CoroutineExceptionHandler` : ์ฝ๋ฃจํด์์ ๋ฐ์ํ ์์ธ ์ฒ๋ฆฌ Coroutine Context ๊ตฌ์ฑCoroutine Context ๊ตฌ์ฑํค - ๊ฐ ์์ผ๋ก ๊ตฌ์ฑ ์์๋ฅผ ๊ด๋ฆฌ`CoroutineContext` ๊ฐ์ฒด ๊ฐ์ ๋ํ๊ธฐ ์ฐ์ฐ์(+)๋ฅผ ์ฌ์ฉํ์ฌ ๊ฐ์ฒด๋ฅผ ๊ตฌ์ฑval coroutineContext: CoroutineContext = newSingleThreadContext("MyThread") + ..