Skip to content

Commit 4b7e1b2

Browse files
committed
2024-10-15 23:52 Braindump
1 parent 1da0b4e commit 4b7e1b2

File tree

1 file changed

+98
-12
lines changed

1 file changed

+98
-12
lines changed

src/_drafts/braindump.md

Lines changed: 98 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@
1111
- Rails 8.0에 표준으로 들어가게 될 라이브러리인데 찍먹을 하고 있는 중
1212

1313

14-
SolidQueue를 이용하려면 여러개의 Actor를 구성해야 함.
14+
SolidQueue를 이용하려면 여러개의 Actor를 구성해야 함.
1515
- Worker : 큐에 밀려있는 것들을 ready to run 상태로 바꾸고 그것을 처리하는 역할.
16-
- SolidQueue::ReadyExecution 인스턴스를 만드는 역할
16+
- SolidQueue::ReadyExecution 인스턴스를 만드는 역할
1717
- Dispatchers : ready to run인 상태인 작업들을 선택하고 이것들을 SolidQueue::ScheduledExecution 인스턴스로 만드는 역할.
18-
- Scheduler : recurring task를 관리하는 역할이며, due가 다가왔을때 큐에 밀어넣는 역할
18+
- Scheduler : recurring task를 관리하는 역할이며, due가 다가왔을때 큐에 밀어넣는 역할
1919
- Supervisor : worker, dispatcher가 configuration에 따라 잘 동작하고 있는지 감시하는 역할. heartbeat를 관리하고, 필요하다면 멈추거나 시작할 수 있음.
2020

2121

2222
Solid Queue's supervisor will fork a separate process for each supervised worker/dispatcher/scheduler.
2323

2424

2525

26-
#### Solid Queue 구성 요소
27-
Solid Queue를 통해서 만들어지는 테이블은 아래와 같음
26+
#### Solid Queue 구성 요소
27+
Solid Queue를 통해서 만들어지는 테이블은 아래와 같음
2828
- solid_queue_blocked_executions
2929
- solid_queue_claimed_executions
3030
- solid_queue_failed_executions
@@ -33,7 +33,7 @@ Solid Queue를 통해서 만들어지는 테이블은 아래와 같음
3333
- solid_queue_processes
3434
- solid_queue_ready_executions
3535
- solid_queue_recurring_executions
36-
- solid_queue_recurring_tasks
36+
- solid_queue_recurring_tasks
3737
- solid_queue_scheduled_executions
3838
- solid_queue_semaphores
3939

@@ -76,7 +76,7 @@ SolidQueue-1.0.0 Register Dispatcher (49.8ms) pid: 24237, hostname: "81a99adfc3
7676
/**
7777
*
7878
* Worker
79-
*
79+
*
8080
*/
8181
8282
SolidQueue::Process Create (24.0ms) INSERT INTO "solid_queue_processes" ("kind", "last_heartbeat_at", "supervisor_id", "pid", "hostname", "metadata", "created_at", "name") VALUES ($1, $2, $3, $4, $5, $6, $7, $8) RETURNING "id" [["kind", "Worker"], ["last_heartbeat_at", "2024-10-03 05:21:08.251287"], ["supervisor_id", 1], ["pid", 24240], ["hostname", "81a99adfc3a7"], ["metadata", "{\"polling_interval\":0.1,\"queues\":\"*\",\"thread_pool_size\":3}"], ["created_at", "2024-10-03 05:21:08.261007"], ["name", "worker-cecda23c162b5f064ef2"]]
@@ -103,7 +103,7 @@ SolidQueue-1.0.0 Unblock jobs (16.3ms) limit: 500, size: 0
103103
```
104104

105105

106-
주기적으로 heartbeat를 보내는 과정에서 실행되는 쿼리
106+
주기적으로 heartbeat를 보내는 과정에서 실행되는 쿼리
107107
```
108108
TRANSACTION (0.5ms) BEGIN
109109
SolidQueue::Process Load (3.8ms) SELECT "solid_queue_processes".* FROM "solid_queue_processes" WHERE "solid_queue_processes"."id" = $1 LIMIT $2 FOR UPDATE [["id", 1], ["LIMIT", 1]]
@@ -160,7 +160,7 @@ GuestsCleanupJob.set(wait_until: Date.tomorrow.noon).perform_later(guest)
160160
SolidQueue 자체로는 대시보드를 제공하지는 않지만, mission_control-jobs 라는 것을 대시보드로 활용할 수 있다.
161161

162162

163-
#### CronJob 돌리기
163+
#### CronJob 돌리기
164164

165165
```
166166
Solid Queue supports defining recurring tasks that run at specific times in the future, on a regular basis like cron jobs. These are managed by the scheduler process and are defined in their own configuration file. By default, the file is located in config/recurring.yml, but you can set a different path using the environment variable SOLID_QUEUE_RECURRING_SCHEDULE or by using the --recurring_schedule_file option with bin/jobs
@@ -181,7 +181,93 @@ production:
181181
182182
183183
184+
RecurringTask가 중복으로 들어가는 이슈가 있음.
185+
그럴때는 SolidQueue::RecurringTask 모델을 뒤적뒤적 거려서 삭제하는 방향으로 해결할 수 있음
186+
187+
188+
189+
190+
191+
2024-10-15
192+
------
193+
194+
## Flutter
195+
196+
Flutter에서 stack 안쪽에 있는 위젯에 터치 이벤트를 전달하고 싶을때는 IgnorePointer를 사용하면 된다.
197+
198+
IgnorePointer는 자식 위젯에게 터치 이벤트를 전달하지 않는다. 그래서 stack 위젯 안쪽에 있는 위젯에게 터치 이벤트를 전달하고 싶을때 사용하면 된다.
199+
200+
IgnorePointer는 본래는 hit test 결과를 무시하는 것이지만, 스냅 이벤트, 터치 이벤트 등등 이벤트 전파를 의도적으로 무시해야하는 경우에는 반드시 쓰는 것을 고려해볼 필요가 있다.
201+
202+
Stack은 특성상 가장 맨 뒤에 진열된 위젯이 가장 위에서 보이게 되며 그에 따라서, 터치 이벤트도 가장 위에 있는 위젯부터 전파되게 된다. 그래서 stack 위젯 안쪽에 있는 위젯에게 터치 이벤트를 전달해야 한다면, 가장 위쪽에 있는 위젯에다가 IgnorePointer를 먹여줘야만 하는 상황이 오게 된다.
203+
204+
```dart
205+
children: [
206+
Container(
207+
height: imageCarouselHeight,
208+
child: Container(
209+
width: double.infinity,
210+
height: imageCarouselHeight,
211+
// image changes when swiping
212+
child: PageView.builder(
213+
itemCount: images.length,
214+
pageSnapping: true,
215+
onPageChanged: (index) {
216+
setState(() {
217+
currentIndex = index;
218+
});
219+
},
220+
physics: BouncingScrollPhysics(),
221+
itemBuilder: (context, index) {
222+
return images[index];
223+
},
224+
)),
225+
),
226+
IgnorePointer(
227+
child: Container(
228+
width: double.infinity,
229+
height: imageCarouselHeight,
230+
decoration: BoxDecoration(
231+
gradient: LinearGradient(
232+
begin: Alignment.topCenter,
233+
end: Alignment.bottomCenter,
234+
colors: [Colors.black.withOpacity(0.5), Colors.transparent],
235+
)),
236+
),
237+
),
238+
IgnorePointer(
239+
child: Container(
240+
width: double.infinity,
241+
height: imageCarouselHeight,
242+
child: Column(children: [
243+
// remaining index and total images
244+
Spacer(),
245+
Row(
246+
mainAxisAlignment: MainAxisAlignment.center,
247+
children: [
248+
SGContainer(
249+
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
250+
borderRadius: BorderRadius.circular(100),
251+
color: Colors.black.withOpacity(0.5),
252+
child: Row(
253+
children: [
254+
SGTypography.body(
255+
"${currentIndex + 1}",
256+
color: Colors.white,
257+
weight: FontWeight.bold,
258+
),
259+
SGTypography.body(
260+
" / ${images.length}",
261+
color: Colors.white.withOpacity(0.5),
262+
),
263+
],
264+
),
265+
),
266+
],
267+
),
268+
SizedBox(height: 12),
269+
])),
270+
),
271+
],
184272

185-
186-
187-
273+
```

0 commit comments

Comments
 (0)