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
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.6k
社会人力と研究力ー博士号をキャリアの武器にするー
kentaro
3
210
IoTシステム開発の複雑さを低減するための統合的アーキテクチャ
kentaro
2
1.9k
Bidirectional Quadratic Voting Leveraging Issue-Based Matching
kentaro
2
580
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
310
「始め方」の始め方 / How to Start Starting Things
kentaro
5
960
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.6k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
680
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
8
6.4k
Other Decks in Technology
See All in Technology
Azure Well-Architected Framework入門
tomokusaba
1
150
AIがコードを書いてくれるなら、新米エンジニアは何をする? / komekaigi2025
nkzn
7
2.3k
What's new in OpenShift 4.20
redhatlivestreaming
0
390
dbtとAIエージェントを組み合わせて見えたデータ調査の新しい形
10xinc
7
1.5k
Zero Trust DNS でより安全なインターネット アクセス
murachiakira
0
120
コンパウンド組織のCRE #cre_meetup
layerx
PRO
1
290
「タコピーの原罪」から学ぶ間違った”支援” / the bad support of Takopii
piyonakajima
0
150
Amazon Athena で JSON・Parquet・Iceberg のデータを検索し、性能を比較してみた
shigeruoda
1
240
AWSが好きすぎて、41歳でエンジニアになり、AAIを経由してAWSパートナー企業に入った話
yama3133
2
200
GPUをつかってベクトル検索を扱う手法のお話し~NVIDIA cuVSとCAGRA~
fshuhe
0
270
書籍『実践 Apache Iceberg』の歩き方
ishikawa_satoru
0
270
激動の時代を爆速リチーミングで乗り越えろ
sansantech
PRO
1
180
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1371
200k
Raft: Consensus for Rubyists
vanstee
140
7.2k
Visualization
eitanlees
150
16k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
How GitHub (no longer) Works
holman
315
140k
Building Adaptive Systems
keathley
44
2.8k
GraphQLとの向き合い方2022年版
quramy
49
14k
Embracing the Ebb and Flow
colly
88
4.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
Into the Great Unknown - MozCon
thekraken
40
2.1k
How to Think Like a Performance Engineer
csswizardry
27
2.2k
BBQ
matthewcrist
89
9.9k
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