Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Async programming is all about programming sync...
Search
seki at druby.org
June 01, 2013
Programming
6
850
Async programming is all about programming synchronously.
RubyKaigi 2013 - 10:00 room A
rev.7
seki at druby.org
June 01, 2013
Tweet
Share
More Decks by seki at druby.org
See All by seki at druby.org
ERB, ancient and future
m_seki
3
750
ERB Hacks
m_seki
1
1.3k
わりこまれるはなし
m_seki
0
680
ぼくのかんがえたさいきょうのけいやくによるプログラミング
m_seki
1
980
Learn Ractor
m_seki
1
2.4k
How many copies did you buy the first print?
m_seki
1
650
Create my own search engine.
m_seki
1
5.2k
Rinda in the real-world embedded systems.
m_seki
0
390
xpjug2019 A-4: チケットシステムの設計と実装、『あのチーム』の運用
m_seki
6
6.4k
Other Decks in Programming
See All in Programming
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
1.9k
Better Code Design in PHP
afilina
PRO
0
130
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
920
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
900
みんなでプロポーザルを書いてみた
yuriko1211
0
260
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Designing for humans not robots
tammielis
250
25k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
The Language of Interfaces
destraynor
154
24k
Done Done
chrislema
181
16k
How to Ace a Technical Interview
jacobian
276
23k
Git: the NoSQL Database
bkeepers
PRO
427
64k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5k
Transcript
Async Asynchronously. ඇಉظͬͯಉظΛॻ͘͜ͱ͡ΌΜɻ
[email protected]
programming is all about programming
Important First ϑολʔʹεϙϯαʔ͕ग़ͯΔ͔ΒݟͯͶ!!
About me
WEB+DB PRESS Vol.73 ʮͨͷ͍͠։ൃ࣮گதܧʯͷϨϏϡʔ͋Γ͕ͱ͏͍͟͝·ͨ͠ (ஶऀҰಉ) code ERB dRuby Rinda Drip
͑Ή͞ΜύΠϯΞϝ1kg͋Γ͕ͱ͏ talk RubyKaigi 2006, 7, 8, 9, 10, 11, 13
RubyConf 2012
ͺ͖ͬΎΔʙΜ!! @tsurumau and write dRuby ʹΑΔ ؔকढ़ஶ ࢄ ɾ Web
ϓϩάϥϛϯά
Answering the RubyConf 2012
ΦʔϜࣾץʰϓϩάϥϛϯάClojure ୈೋ൛ʱࢴͱిࢠॻ੶͋Θͤͯධൃചதʂ @koichiro RubyConf 2012 "dRubyࣦഊ࡞ͩ" dRubyಉظݺͼग़͔ͩ͠Βࣦഊͳ ʁʁʁ ݴ͍༁͠ͳ͍ͱʂ
RubyKaigi2013ָ͠ΈͰ͢ɻ@iwadon ࠓ͓͢Δ͜ͱ ඇಉظʹ͓͜Δ͍ΖΜͳ͜ͱ͍͍ͭͩͨ ͍ಉ͡Α͏ʹղ͘ΜͩΑͬͯ
ΫϦΞίʔυRubyձٞ2013ͷγϧόʔεϙϯαʔͰ͢ ਐΊํ ੈք͍͍ͩͨඇಉظͱಉظͰͰ͖͍ͯΔ ඇಉظ෩ͳঢ়گΛͨ͘͞Μࣔ͠·͢ ͍ͭಉ͡Α͏ʹղ༷͘ࢠΛݟͯͶ
ా͞Μָͬͦ͘͢͝͠͏ʹΛฉ͍ͯ͘Ε·͢ɻൃදͷ͋ͱʹ͔ͭ·͑ͯͯ͠ΈͯͶ ࠓ͓͢Δ͜ͱ 2 Μ͍͘͏ͳ dRubyඇಉظݺͼग़͞Ε RubyͰͰ͖ΔόοΫάϥϯυॲཧ વͰ͖Δͷ
Wait a moment ✓ +3:00ɹ ✓ ࠓͷAgenda ✓ એ͗͢͠ͳ͍ ✓
࣍ඇಉظݺͼग़͞Ε
͙Μ·Ͱ·ͬͯΔ ඇಉظͬͯͳʹ Α͘Θ͔Μͳ͍͚Ͳಉظత͡Όͳ͍ͷʁ ࠓࣗͷ߹ͱؔͳ͘ى͜Δͳʹ͔ɺ ͱ͠·͢
͔͚͠ͳ͍ͰΒ͑·͔͢ @track8 ඇಉظݺͼग़͞Εܥ ࣗͷ߹ʹؔͳ͘ݺΕΔ UNIX signal dRuby RMI
9/21 ͱͪ͗Rubyձٞ05ΑΖ͓͘͠Ͷ͕͍͠·͢ @mame UNIX signal ͳʹΛ͍ͯͯ͠ɺಥવొ͞Ε͕ͨؔݺ Εͯɺ͖ͬ͞ͷͱ͜Ζ͔Β࠶։͢Δ ओॲཧγάφϧ͕ൃੜͨ͜͠ͱΛΒͳ͍
͕Μͬ౦! @MUNAKATA_Akiko UNIX signal ͳʹΛ͍ͯͯ͠ɺಥવొ͞Ε͕ͨؔݺ Εͯɺ͖ͬ͞ͷͱ͜Ζ͔Β࠶։͢Δ int foo() { while(1)
{ bar(); baz(); } } int signal_hanlder(...) { }
Lang-8૬ޓఴܕSNSͰɺ190ϲࠃ͔Β80छྨҎ্ͷݴޠͰར༻͞Εͯ·͢ɻ@sasata299 dRuby RMI dRubyඇಉظݺͼग़͞ΕͰ͋Δ RMI͝ͱʹ৽͍͠εϨου͕Ͱ͖ͯॲཧ͢Δ ଞͷεϨουRMI͕͋ͬͨ͜ͱΛΒͳ͍
Δؾφϯγʔ @vestige_ dRuby RMI RMI͝ͱʹ৽͍͠εϨου͕Ͱ͖ͯॲཧ͢Δ ଞͷεϨουRMI͕͋ͬͨ͜ͱΛΒͳ͍ DRb.start_service(...) DRb.thread.join class Service
def foo ... end end
Yokohama.rbຖ݄ୈ2༵։࠵Ͱ͢ʂ ඇಉظݺͼग़͞Εͷಛ ·͞ʹඇಉظ ࣗͷ߹ʹؔͳ͘ݺͼग़͞ΕΔ ͦͯ͠ݺͼग़͞Εͨ͜ͱΛΒͳ͍ ݺΕͨΒͳʹ͔͢Δɺ͕ॻ͖ʹ͍͘
֏͞ΜڃʹΓͳ͍ʰͳΔ΄ͲUNIXϓϩηεʱୡਓग़൛ձ͔ΒେධൃചதͰ͢!! @kakutani ݺͼग़͞Εͨ͜ͱΛ͑Δ ͑Δνϟϯε͕͋Δͷݺͼग़͞Εͨଆ Ͳ͏ͬͯ͑Δʁ Global Variables Synchronization Mechanisms
ελʔτΞοϓRuby Kindle൛͡Ί·ͨ͠ @igaiga555 Global Variables ඇಉظʹݺͼग़͞Εͨ͜ͱΛϝϞ͢Δ ͰϝϞͨ͜͠ͱΛͯͳ͍ ϙʔϦϯά busy loopʹͳΔ͔...
EINTRͱ͏·͘Έ߹ΘͤΔͷख
hikari no cafe Ұॹʹߦ͜͏! ฏʹ༡ͼʹ͖ͯ!! > @ay Synchronization Mechanisms εϨουؒͷ߹ͤɺݴ
͕݅ἧ͏·ͰٳΉ εϨου͕ผεϨουʹใΛ͑Δ εϨου͕ผεϨου͔ΒͷใΛड͚Δ
@nagachika͞Μͷruby-trunk-changesɺ͍ͭݟͯ·͢! Latch, Semaphore, Monitor ͕݅ἧ͏·Ͱͭ ͋ͷඇಉظݺͼग़͕͋ͬͨ͠Αʂͱ͔Ͷ
6/5ͷAWS Summit Tokyo 2013Ͱ͠ΌΓ·͢ɻςΫχΧϧτϥοΫʹ͋ͿΕͨํͥͻɻ @tsuboi Queue ͯΔ্ʹϞϊΛͤΔ FIFO ͍͑ͨΦϒδΣΫτΛpush, pop
ۭͷͱ͖ΦϒδΣΫτ͕ಧ͘·ͰٳΉ
ϑΣΠτɾςελϩοα http://www.fatechan.com Queue QueueΛհʹೋͭεϨου͕ಉظ͢Δ while req = $q.pop do_it(req) end
ϑΣΠτɾςελϩοα http://www.fatechan.com Queue QueueΛհʹೋͭεϨου͕ಉظ͢Δ while req = $q.pop do_it(req) end
class Service def foo(bar) $q.push(bar) end end
ϑΣΠτɾςελϩοα http://www.fatechan.com Queue QueueΛհʹೋͭεϨου͕ಉظ͢Δ while req = $q.pop do_it(req) end
class Service def foo(bar) $q.push(bar) end end
ϑΣΠτɾςελϩοα http://www.fatechan.com Queue QueueΛհʹೋͭεϨου͕ಉظ͢Δ while req = $q.pop do_it(req) end
class Service def foo(bar) $q.push(bar) end end sync!!!
ϑΣΠτɾςελϩοα http://www.fatechan.com Queue QueueΛհʹೋͭεϨου͕ಉظ͢Δ while req = $q.pop do_it(req) end
class Service def foo(bar) $q.push(bar) end end sync!!!
RubyKaigi 2013ແࣄϦϦʔε͞ΕͯͨΒiRubyKaigi'13ͰνΣοΫ!! @gutskun socket ... ಉظϝΧχζϜͱݺΕͯͳ͍͚Ͳ... FIFO σʔλͷ౸ணΛͯΔ σʔλΛͤΔ
@hemge ʹձͬͨͷRubyձٞ2007Ͱͨ͠Ͷʔɻࠓͦ͜দߐͷ՛ࢠ͞ΜҊ͍ͯͩ͘͠͞ɻ Rinda::TupleSpace ॱংʹ͖·Γ͕ͳ͍ λϓϧͷऔΓग़͠ʹΑΔ߹ͤͱใަ ύλʔϯϚον ActorϞσϧͷϝοηʔδͷج൫ʹ߹͏Α Τʔςϧ
ΤϯδχΞืूதͰ͢ bit.ly/cookpad_jobs @mrkn Rinda::TupleSpace TupleSpaceΛத৺ʹෳͷεϨου͕ಉظ ඇಉظݺͼग़͞Εؔͳ͍͚ͲӈଆͶ req = $ts.take([:req, ..])
value = do_it(req) $ts.write([:ans, value])
ΤϯδχΞืूதͰ͢ bit.ly/cookpad_jobs @mrkn Rinda::TupleSpace TupleSpaceΛத৺ʹෳͷεϨου͕ಉظ ඇಉظݺͼग़͞Εؔͳ͍͚ͲӈଆͶ req = $ts.take([:req, ..])
value = do_it(req) $ts.write([:ans, value]) $ts.write([:req, ..]) $ts.take([:ans, nil])
ΤϯδχΞืूதͰ͢ bit.ly/cookpad_jobs @mrkn Rinda::TupleSpace TupleSpaceΛத৺ʹෳͷεϨου͕ಉظ ඇಉظݺͼग़͞Εؔͳ͍͚ͲӈଆͶ req = $ts.take([:req, ..])
value = do_it(req) $ts.write([:ans, value]) $ts.write([:req, ..]) $ts.take([:ans, nil]) sync!!!
ΤϯδχΞืूதͰ͢ bit.ly/cookpad_jobs @mrkn Rinda::TupleSpace TupleSpaceΛத৺ʹෳͷεϨου͕ಉظ ඇಉظݺͼग़͞Εؔͳ͍͚ͲӈଆͶ req = $ts.take([:req, ..])
value = do_it(req) $ts.write([:ans, value]) $ts.write([:req, ..]) $ts.take([:ans, nil]) sync!!!
ΤϯδχΞืूதͰ͢ bit.ly/cookpad_jobs @mrkn Rinda::TupleSpace TupleSpaceΛத৺ʹෳͷεϨου͕ಉظ ඇಉظݺͼग़͞Εؔͳ͍͚ͲӈଆͶ req = $ts.take([:req, ..])
value = do_it(req) $ts.write([:ans, value]) $ts.write([:req, ..]) $ts.take([:ans, nil]) sync!!! sync!!!
ΤϯδχΞืूதͰ͢ bit.ly/cookpad_jobs @mrkn Rinda::TupleSpace TupleSpaceΛத৺ʹෳͷεϨου͕ಉظ ඇಉظݺͼग़͞Εؔͳ͍͚ͲӈଆͶ req = $ts.take([:req, ..])
value = do_it(req) $ts.write([:ans, value]) $ts.write([:req, ..]) $ts.take([:ans, nil]) sync!!! sync!!!
Ұॹʹ͋ͷөըΛݟ͍ͨͰ͢ɻ > @nari3 ·ͱΊ ඇಉظʹݺͼग़͞Εͨ݁ՌΛΔͷ໘ ಉظϝΧχζϜΛ͏ͱ͑Δ͜ͱ͕Ͱ͖Δ
Wait a moment ✓ +13:00ɹ ✓ dRubyඇಉظݺͼग़͞Ε ✓ ݺͼग़͞Εͨ݁ՌΛผεϨουʹ͑Δಉظ ✓
࣍ଈ࣌෮ؼ
֏͞ΜͷಠಛͷงғؾಌΕ·͢! ֻ͍͔͚ͭ͠ʹ͍͖·͢! - @elim όοΫάϥϯυॲཧ ଈ࣌෮ؼ ॲཧΛड͚͚ͨΒ੍ޚ͕Δ ड͚͚ॲཧͩͱࢥ͏ͱྃͯ͠Δ
The dRuby Book ຊޠ൛δϡϯΫಊͰۚͰങ͑Δ ͜Εඇಉظʁ ͏ʔΜ ࣗͷ߹ͱؔͳ͘ॲཧΛ࣮ߦ ࣗͷ߹ͱؔͳྃ͘
9/21 ಹਢԘݪ ͱͪ͗Rubyձٞ05 Eiffelຊ༁ऀͷञ͞Μ͕͘ΔΑʂ ݁Ռ͕ؾʹͳΔ ଈ࣌෮ؼͷଟ͘ͷ߹ Γͬͺͳ͠Ͱͳ͘ ݁Ռʹڵຯ͕͋Δ ݁ՌΛͭAPI͕༻ҙ͞ΕͯΔ
The dRuby Book Japanese Edition : Best as GIFT FROM
JAPAN جຊతͳύλʔϯ ॲཧΛґཔ → νέοτΒ͏! ฒߦͯࣗ͠ͷࣄΛ͢Δ νέοτͬͯґཔͷ݁ՌΛͭ←ಉظ͢Δ
` service جຊతͳύλʔϯ d request join ticket value application background
task
dRubyHiroba - dRuby hands-on 6/2 10:30- (RubyHiroba) νέοτͷྫ ιέοτͦͷͷ͕νέοτ ґཔΛॻ͖ɺ݁ՌΛಡΉ
popenͳͲࣅͨΑ͏ͳͷ ticket = TCPClient.new(...) ticket.write('your task') my_important_task ticket.read
2013-9-21 ͱͪ͗Rubyձٞ05 @ ಹਢԘݪࢢ౦ಹਢެຽؗ νέοτͷྫ εϨουνέοτͷΑ͏ʹ͑Δ joinͰ߹ͤͱͷऔಘ͕ҰʹͰ͖ΔΑ ticket = Thread.new
{ your_task } my_important_task ticket.join
The dRuby Book νέοτͷྫ λϓϧεϖʔεͳΒλϓϧ ticket = Object.new tuple_space.write([:your_task, ticket])
my_important_task tuple_space.take([:your_task_done, ticket])
ʮαϯϥΠζग़ӢͰߦ͘ RubyWorld Conference 2013 ʯಉߦऀืूதʂ @yancya ͕ࣗ͠αʔόͩͬͨΒ ॲཧΛґཔ ฒߦͯࣗ͠ͷࣄ͢Δ νέοτͬͯґཔͷ݁ՌΛͭ
ʮαϯϥΠζग़ӢͰߦ͘ RubyWorld Conference 2013 ʯಉߦऀืूதʂ @yancya ͕ࣗ͠αʔόͩͬͨΒ ॲཧΛґཔ ฒߦͯࣗ͠ͷࣄΛ͢Δ νέοτͬͯґཔͷ݁ՌΛͭ
ґཔΛͭ
ʮαϯϥΠζग़ӢͰߦ͘ RubyWorld Conference 2013 ʯಉߦऀืूதʂ @yancya ͕ࣗ͠αʔόͩͬͨΒ ॲཧΛґཔ ฒߦͯࣗ͠ͷࣄΛ͢Δ νέοτͬͯґཔͷ݁ՌΛͭ
ґཔΛͭ ೋछྨ͍ͪͨ
dRubyHiroba - dRuby hands-on 6/2 10:30- (RubyHiroba) ͪํ͕·ͪ·ͪͩͱࠔΔ or Ͱͭͳ͛ͳ͍
࠷ॳͷ߹ͤͰࢭ·ͬͪΌ͏ ͍Ζ͍ΖҰʹͯͳ͍ͱμϝ queue.pop or soc.read or rinda.take or ...
dRubyHiroba - dRuby hands-on 6/2 10:30- (RubyHiroba) ҰൠԽͨ͠αʔόͷϧʔϓ ͍Ζ͍Ζ·ͱΊͯͭ ৽͍͠ґཔͳΒ...
ྃ௨ͳΒ...
dRubyHiroba - dRuby hands-on 6/2 10:30- (RubyHiroba) ۉ࣭ʹͯ͠·ͱΊͯͭ ͲΕಉ͡APIͰͯΔΑ͏ʹۉ࣭ʹ͢Δ select()શͯΛϑΝΠϧʹͯ͠Δ
TupleSpacetupleʹਖ਼نԽ
dRubyHiroba - dRuby hands-on 6/2 10:30- (RubyHiroba) ·ͱΊ ଈ࣌෮ؼ͢Δͱ͖ɺ͍͍ͨͯ݁Ռ͕ؾʹͳΔ ݁ՌΛͭͷಉظ
ඇಉظݺͼग़͞Εͱಉ͡Α͏ͳײ͡
Wait a moment ✓ +22:00ɹ ✓ ଈ࣌෮ؼͰಉظ͕ϛι ✓ ͚࣍ࣗͩݻ·Βͳ͍ྗͷ͜ͱ
Ruby's GC slide is here! : slidesha.re/19sbBwA (w/o animation, free
ver) and gumroad.com/l/xWCR (w/ animation, premium ver) selectଐϝΠϯϧʔϓ select(ͨ͘͞Μͷιέοτ) ϒϩοΫ͠ͳ͍ιέοτͷಡΈॻ͖ ͳʹ͔ॲཧΛ͢Δ
͵Ruby൪ɺ͍͓ͭੈʹͳ͓ͬͯΓ·͢ʂTIMEXɺ͔Θ͍͍Ͱ͋Γ·͢ʂ ίʔϧόοΫͷύλʔϯ select(ͨ͘͞Μͷιέοτ) ϒϩοΫ͠ͳ͍ιέοτͷಡΈॻ͖ ͳʹ͔ॲཧΛ͢Δ ϑϨʔϜϫʔΫ͕Ӆ͢ ͜ͷลίʔϧόοΫ
The dRuby Book ίʔϧόοΫͷ᠘ select(ͨ͘͞Μͷιέοτ) ϒϩοΫ͠ͳ͍ιέοτͷಡΈॻ͖ ͳʹ͔ॲཧΛ͢Δ ϑϨʔϜϫʔΫશମ͕͘ ͳΔ ͕͍͜͜ͱ
The dRuby Book ίʔϧόοΫͷ᠘ select(ͨ͘͞Μͷιέοτ) ϒϩοΫ͠ͳ͍ιέοτͷಡΈॻ͖ ͳʹ͔ॲཧΛ͢Δ ૬ޓʹݺͼ߹͍ͬͯΔͱγεςϜશ ମ͕ݻ·Δ... ͞Βʹผαʔόʹґཔͨ͘͠
ͯ͜͜Ͱ݁ՌΛͭͱ
The dRuby Book ίʔϧόοΫͷ᠘ select(ͨ͘͞Μͷιέοτ) ϒϩοΫ͠ͳ͍ιέοτͷಡΈॻ͖ ͳʹ͔ॲཧΛ͢Δ ͠ΐ͏͕ͳ͍͔Β݁Ռͪselect ϑϨʔϜϫʔΫͷཧ֎Ͱͭ͜ͱʹ
http://www.amazon.co.jp/registry/wishlist/1R43BBPSPUEEE/ γϯάϧεϨου ॲཧ͕Ͳ͜·ͰਐΜ͔ͩίϯςΩετΛ࡞ͬ ͯɺॲཧதͰϝΠϯϧʔϓʹΔ ࣗવͳίʔυʹ͢Δͷۤ࿑͢Δ Fiberͱ͔ܧଓͱ͔...
2013-9-21ͱͪ͗Rubyձٞ05 @ ಹਢԘݪࢢ౦ಹਢެຽؗ ͋Εʁ ιέοτͷͪͱFiberͳΒThreadͱେࠩͳ ͍ͷͰʁ
2013-9-21ͱͪ͗Rubyձٞ05 @ ಹਢԘݪࢢ౦ಹਢެຽؗ ϚϧνεϨουͰղ͘ acceptͨ͠ΒThreadੜͯ͠readɺॲཧɺ write͢Δ ίϯςΩετͷอଘ෮ݩ͕ෆཁ ࣗવͳίʔυ͕ॻ͚Δ ͍ॲཧͰ͖Δ͠ɺผαʔϏεʹྃ ෮ؼͰґཔͯ͠ྑ͍
2013-9-21ͱͪ͗Rubyձٞ05 @ ಹਢԘݪࢢ౦ಹਢެຽؗ dRubyͷ࣮ͦͷͷ େࣄͳΦνͰ͢Α!! Rubyʹ͓͚Διέοταʔόͷయܕ shttpsrv (ݪ͞ΜͷHTTPαʔόʔ) ඇৗʹૉ dRubyͦͷΑ͏ʹ࡞ΒΕ͍ͯΔ
dRubyHiroba - dRuby hands-on 6/2 10:30- (RubyHiroba) ·ͱΊ ඇಉظʹ͓͜Δ͍ΖΜͳ͜ͱ͍͍ͭͩͨ ͍ಉ͡Α͏ʹղ͘ΜͩΑͬͯͰͨ͠
dRubyHiroba - dRuby hands-on 6/2 10:30- (RubyHiroba) ͱͪ͗RubyKaigi 05 2013-9-21
ಹਢԘݪ টߨԋ: ञ