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
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
330
IoTシステム開発の複雑さを低減するための統合的アーキテクチャ
kentaro
2
2.5k
Bidirectional Quadratic Voting Leveraging Issue-Based Matching
kentaro
2
790
大高生へのメッセージ(令和6年度「大高未来塾」) / Messages to Current Students
kentaro
0
350
「始め方」の始め方 / 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
780
先行きの見えなさを楽しさに変える ーVUCA時代のキャリア論と絶対他力主義ー / How to develop your career in the VUCA era
kentaro
8
6.9k
Other Decks in Technology
See All in Technology
”AIを使う” から ”AIに任せる” へ ─ 開発プロセスを再設計してAIを組織標準にするまで
cyberagentdevelopers
PRO
1
140
PHPで作って学ぶリアルタイム音声対話AIとWebSocket入門 by ムナカタ
munakata
0
140
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
1.3k
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
260
副作用のある Lambda でも Lambda Power Tuning は使えるのか / lambda-power-tuning-side-effects
koukihosaka
1
140
発表と総括 / Presentations and Summary
ks91
PRO
0
190
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
1
1.1k
AI、CDK と協働する Full TypeScript アプリケーション開発 / Full TypeScript Application with AI and CDK
geekplus_tech
2
480
「休む」重要さ
smt7174
6
1.6k
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.5k
JAWS_ICEBERG_BASECAMP
iqbocchi
2
110
AIエージェントがあれば技術書なんてすぐ書けるでしょ→無理でした
watany
2
290
Featured
See All Featured
A Soul's Torment
seathinner
6
3.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Fireside Chat
paigeccino
42
4k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
380
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
190
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Technical Leadership for Architectural Decision Making
baasie
3
440
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
220
The Cost Of JavaScript in 2023
addyosmani
55
10k
The Curse of the Amulet
leimatthew05
2
13k
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