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
Glint
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Kentaro Kuribayashi
June 07, 2013
Technology
3.7k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Glint
RedDotRubyConf 2013
http://www.reddotrubyconf.com/
Kentaro Kuribayashi
June 07, 2013
More Decks by Kentaro Kuribayashi
See All by Kentaro Kuribayashi
あとはAIに任せて人間は自由に生きる
kentaro
5
2.2k
社会人力と研究力ー博士号をキャリアの武器にするー
kentaro
3
340
IoTシステム開発の複雑さを低減するための統合的アーキテクチャ
kentaro
2
2.5k
Bidirectional Quadratic Voting Leveraging Issue-Based Matching
kentaro
2
800
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
360
「始め方」の始め方 / How to Start Starting Things
kentaro
5
1k
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.7k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
800
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
8
7k
Other Decks in Technology
See All in Technology
サイバー捜査員研修(前半)
nomizone
1
2k
Agent 時代の Kaggle 展望 / kaggle-in-the-agentic-era
upura
1
720
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.9k
その“隠したつもり”が命取り ── 自前と平文をやめて「正解」に委ねる
kuroneko13
0
120
AWS ネットワーク構築でハマった(ハマりかけた) 5選とそこから得た教訓
nagisa53
4
210
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
LanceDB入門
mocobeta
7
500
事業価値と Engineering 2026年度版
recruitengineers
PRO
49
23k
取引先から届く 「セキュリティチェックシート」の読み解き方
kamadamakoto
0
150
Digitization部 紹介資料
sansan33
PRO
2
7.7k
FORENSIA: ローカルLLMフォレンジックハーネス
sumeshi
2
390
同じWAFが、攻撃の“形”は弾く── 正当な“形”の不正は通す
kuroneko13
0
190
Featured
See All Featured
Leo the Paperboy
mayatellez
8
2.1k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Amusing Abliteration
ianozsvald
1
240
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
390
For a Future-Friendly Web
brad_frost
183
10k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Google's AI Overviews - The New Search
badams
0
1.1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.6k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
430
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
119
120k
Transcript
Glint Fires arbitrary TCP servers http://www.flickr.com/photos/tjblackwell/3107540997/
@kentaro Software engineer to build technical basis Rubyist / Perl
Monger Kentaro Kuribayashi paperboy&co.
None
Problem
Applications often consists of various components
• Cache servers • Storage servers • Job queue/workers •
Other applications (e.g. external APIs) • etc.
• Launch servers in advance (e.g mysql/pg with Rails) •
Stub out connections to the servers (e.g. stub/mock in RSpec) To deal with it, you may:
Launching Servers • We don’t always need such many servers
• It can be waste of limited resources of our daily- used local machine
Stubbing out Connections • Efficient way to test apps that
depends on external components • But we can’t tell whether or not our apps work well indeed against real servers
Solution
Glint
Glint is a library which allows you to fire arbitrary
TCP servers to help you test your codes against those real servers without stubbing out.
1. Fork a child process for a TCP server 2.
Find an empty port for the server 3. Exec the server program using the port 4. Destroy the child process when it’s no longer needed
1. Fork a child process for a TCP server 2.
Find an empty port for the server 3. Exec the server program using the port 4. Destroy the child process when it’s no longer needed
Basic usage
With RSpec
servers/memcached.rb
spec_helper.rb
**_spec.rb
App + External App
initializer/**.rb
**_spec.rb
TCP server + TCP server
Fluentd::Integration
How Glint Cleans up the Servers
http://ruby-doc.org/core-2.0/ObjectSpace.html “ObjectSpace also provides support for object finalizers, procs that
will be called when a specific object is about to be destroyed by garbage collection.”
glint/server.rb Glint::Server#stop
• Stubbing out external connection may cause some problems •
Glint allows you to easily fire up TCP servers as you need • Patches are welcome! Recap