Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Glint
Search
Kentaro Kuribayashi
June 07, 2013
Technology
2
3.6k
Glint
RedDotRubyConf 2013
http://www.reddotrubyconf.com/
Kentaro Kuribayashi
June 07, 2013
Tweet
Share
More Decks by Kentaro Kuribayashi
See All by Kentaro Kuribayashi
あとはAIに任せて人間は自由に生きる
kentaro
4
1.7k
社会人力と研究力ー博士号をキャリアの武器にするー
kentaro
3
240
IoTシステム開発の複雑さを低減するための統合的アーキテクチャ
kentaro
2
2k
Bidirectional Quadratic Voting Leveraging Issue-Based Matching
kentaro
2
610
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
320
「始め方」の始め方 / How to Start Starting Things
kentaro
5
970
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.6k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
690
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
8
6.4k
Other Decks in Technology
See All in Technology
re:Invent2025とAWS Builder Cards Resilience Expansionのご紹介
tsuwa61
1
110
オープンデータの内製化から分かったGISデータを巡る行政の課題
naokim84
2
1k
原理から解き明かす AIと人間の成長 - Progate BAR
teba_eleven
2
220
GitHub を組織的に使いこなすために ソニーが実践した全社展開のプラクティス
sony
18
9.2k
学術的根拠から読み解くNotebookLMの音声活用法
shukob
1
560
タグ付きユニオン型を便利に使うテクニックとその注意点
uhyo
1
270
AI エージェント活用のベストプラクティスと今後の課題
asei
2
410
Kill the Vibe?Architecture in the age of AI
stoth
1
130
Flutter Thread Merge - Flutter Tokyo #11
itsmedreamwalker
1
120
なぜフロントエンド技術を追うのか?なぜカンファレンスに参加するのか?
sakito
4
1.4k
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
15k
ブラウザ拡張のセキュリティの話 / Browser Extension Security
flatt_security
0
220
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
Building an army of robots
kneath
306
46k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Unsuck your backbone
ammeep
671
58k
Why Our Code Smells
bkeepers
PRO
340
57k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Scaling GitHub
holman
464
140k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
For a Future-Friendly Web
brad_frost
180
10k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
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