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
2
3.7k
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.9k
社会人力と研究力ー博士号をキャリアの武器にするー
kentaro
3
260
IoTシステム開発の複雑さを低減するための統合的アーキテクチャ
kentaro
2
2.2k
Bidirectional Quadratic Voting Leveraging Issue-Based Matching
kentaro
2
660
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
330
「始め方」の始め方 / How to Start Starting Things
kentaro
5
980
Dynamic IoT Applications and Isomorphic IoT Systems Using WebAssembly
kentaro
1
1.6k
わたしがこのところハマっている「ライセンスフリー無線」のご紹介 / An Invitation to License-Free Radio
kentaro
1
710
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
8
6.6k
Other Decks in Technology
See All in Technology
Agile Leadership Summit Keynote 2026
m_seki
1
560
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1k
配列に見る bash と zsh の違い
kazzpapa3
1
120
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
220
外部キー制約の知っておいて欲しいこと - RDBMSを正しく使うために必要なこと / FOREIGN KEY Night
soudai
PRO
12
5.1k
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
200
Bedrock PolicyでAmazon Bedrock Guardrails利用を強制してみた
yuu551
0
190
Digitization部 紹介資料
sansan33
PRO
1
6.8k
Embedded SREの終わりを設計する 「なんとなく」から計画的な自立支援へ
sansantech
PRO
3
2.3k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
910
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
320
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Designing for Performance
lara
610
70k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
350
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
A Soul's Torment
seathinner
5
2.2k
Accessibility Awareness
sabderemane
0
51
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
64
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
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