MCPcopy Create free account

hub / github.com/badu/bus / functions

Functions77 in github.com/badu/bus

↓ 27 callersFunctionSub
Sub subscribes a callback function to listen for a specie of events recovererInfo is declared as variadic, in order not to break the previous version,
main.go:189
↓ 14 callersFunctionPub
Pub publishes an event which will be dispatched to all listeners
main.go:243
↓ 13 callersMethodSub
Sub adds a callback to be called when an event of that type is being published
main.go:45
↓ 11 callersMethodPub
Pub allows you to publish an event in that topic
main.go:99
↓ 4 callersMethodClose
()
test_scenarios/factory-request-reply/events/main.go:51
↓ 3 callersMethodGetOrderStatus
(ctx context.Context, orderID int)
test_scenarios/request-reply-callback/orders/service.go:29
↓ 3 callersMethodRegisterOrder
(ctx context.Context, productIDs []int)
test_scenarios/request-reply-callback/orders/service.go:21
↓ 2 callersMethodAddProductToCart
(ctx context.Context, productID string)
test_scenarios/factory-request-reply/cart/service.go:23
↓ 2 callersMethodRegisterUser
(ctx context.Context, name, phone string)
test_scenarios/fire-and-forget/users/service.go:21
↓ 2 callersMethodReply
()
test_scenarios/factory-request-reply/events/main.go:46
↓ 2 callersFunctionSubCancel
SubCancel can be used if you need to unsubscribe immediately after receiving an event, by making your function return true recovererInfo is declared a
main.go:130
↓ 1 callersMethodCancel
Cancel allows callers to manually unsubscribe, in case they don't want to use SubCancel
main.go:121
↓ 1 callersMethodCreateOrder
(ctx context.Context, productIDs []int)
test_scenarios/request-reply-with-cancellation/orders/service.go:18
↓ 1 callersMethodEventID
()
main.go:15
↓ 1 callersMethodGetPricesForProduct
(ctx context.Context, in *ProductIDRequest)
test_scenarios/factory-request-reply/prices/grpc_client.go:8
↓ 1 callersMethodGetStockForProduct
(ctx context.Context, in *ProductIDRequest)
test_scenarios/factory-request-reply/inventory/grpc_client.go:8
↓ 1 callersFunctionNewAuditService
(sb *strings.Builder)
test_scenarios/fire-and-forget/audit/service.go:15
↓ 1 callersFunctionNewEmailService
(sb *strings.Builder)
test_scenarios/fire-and-forget/notifications/email_service.go:15
↓ 1 callersFunctionNewEventState
(ctx context.Context)
test_scenarios/request-reply-with-cancellation/events/main.go:13
↓ 1 callersFunctionNewInventoryGRPCClientRequestEvent
()
test_scenarios/factory-request-reply/events/main.go:16
↓ 1 callersFunctionNewPricesGRPCClientRequestEvent
()
test_scenarios/factory-request-reply/events/main.go:36
↓ 1 callersFunctionNewRepository
(sb *strings.Builder)
test_scenarios/request-reply-callback/orders/repository.go:26
↓ 1 callersFunctionNewRepository
()
test_scenarios/request-reply-with-cancellation/orders/repository.go:19
↓ 1 callersFunctionNewService
(sb *strings.Builder)
test_scenarios/factory-request-reply/cart/service.go:18
↓ 1 callersFunctionNewService
(sb *strings.Builder)
test_scenarios/request-reply-callback/orders/service.go:16
↓ 1 callersFunctionNewService
(sb *strings.Builder)
test_scenarios/fire-and-forget/users/service.go:16
↓ 1 callersFunctionNewService
()
test_scenarios/request-reply-with-cancellation/orders/service.go:13
↓ 1 callersFunctionNewSmsService
(sb *strings.Builder)
test_scenarios/fire-and-forget/notifications/sms_service.go:15
↓ 1 callersFunctionRange
Range gives access to mapper Range
main.go:262
↓ 1 callersMethodWaitReply
()
test_scenarios/factory-request-reply/events/main.go:22
↓ 1 callersMethodWaitReply
()
test_scenarios/factory-request-reply/events/main.go:42
↓ 1 callersMethodcancel
cancel is private to the topic, but can be accessed via Listener
main.go:62
FunctionBenchmarkBroadcast_0008
(b *testing.B)
bench_test.go:18
FunctionBenchmarkBroadcast_0008Ptr
(b *testing.B)
bench_test.go:34
FunctionBenchmarkBroadcast_0256
(b *testing.B)
bench_test.go:50
FunctionBenchmarkBroadcast_0256Ptr
(b *testing.B)
bench_test.go:66
FunctionBenchmarkBroadcast_1k
(b *testing.B)
bench_test.go:82
FunctionBenchmarkBroadcast_1kPtr
(b *testing.B)
bench_test.go:98
FunctionBenchmarkBroadcast_2k
(b *testing.B)
bench_test.go:114
FunctionBenchmarkBroadcast_2kPtr
(b *testing.B)
bench_test.go:130
MethodCancel
Cancel forgets the indicated callback
main.go:89
MethodClose
()
test_scenarios/factory-request-reply/main_test.go:27
MethodClose
()
test_scenarios/request-reply-with-cancellation/events/main.go:20
MethodGetPricesForProduct
(ctx context.Context, in *prices.ProductIDRequest)
test_scenarios/factory-request-reply/main_test.go:20
MethodGetPricesForProduct
(ctx context.Context, productID string)
test_scenarios/factory-request-reply/prices/service.go:16
MethodGetStockForProduct
(ctx context.Context, in *inventory.ProductIDRequest)
test_scenarios/factory-request-reply/main_test.go:41
MethodGetStockForProduct
(ctx context.Context, productID string)
test_scenarios/factory-request-reply/inventory/service.go:16
FunctionNewRequestEvent
(payload T)
test_scenarios/request-reply-callback/events/main.go:9
FunctionNewService
()
test_scenarios/factory-request-reply/prices/service.go:10
FunctionNewService
()
test_scenarios/factory-request-reply/inventory/service.go:10
FunctionNewTopic
NewTopic creates a new topic for a specie of events
main.go:32
MethodNumSubs
NumSubs in case you need to perform tests and check the number of subscribers of this particular topic
main.go:81
MethodOnCreateOrder
(event events.CreateOrderEvent)
test_scenarios/request-reply-with-cancellation/orders/repository.go:25
FunctionOnDummyEvent
(event *events.DummyEvent)
test_scenarios/fire-and-forget/main_test.go:17
FunctionOnInventoryGRPCClientStubRequest
(e *events.InventoryGRPCClientRequestEvent)
test_scenarios/factory-request-reply/main_test.go:45
FunctionOnPricesGRPCClientStubRequest
(e *events.PricesGRPCClientRequestEvent)
test_scenarios/factory-request-reply/main_test.go:31
MethodOnSMSRequestEvent
OnSMSRequestEvent is a pub-unsub type, we have to return 'false' to continue listening for this kind of events
test_scenarios/fire-and-forget/audit/service.go:29
MethodOnSMSSendRequest
(event events.SMSRequestEvent)
test_scenarios/fire-and-forget/notifications/sms_service.go:21
MethodOnSMSSentEvent
OnSMSSentEvent is a pub-unsub type where we give up on listening after receiving first message
test_scenarios/fire-and-forget/audit/service.go:34
MethodOnSomeOtherEvent
(event SomeOtherEvent)
main_test.go:179
MethodOnUserRegisteredEvent
(e events.UserRegisteredEvent)
test_scenarios/fire-and-forget/notifications/email_service.go:21
MethodOnUserRegisteredEvent
OnUserRegisteredEvent is classic event handler
test_scenarios/fire-and-forget/audit/service.go:24
MethodReply
()
test_scenarios/factory-request-reply/events/main.go:26
FunctionReset
Reset allows usage in tests that shares the bus
main.go:267
FunctionTestBus
(t *testing.T)
main_test.go:84
FunctionTestGRPCClientStub
(t *testing.T)
test_scenarios/factory-request-reply/main_test.go:53
FunctionTestRace
TestRace with `go test -run TestRace -race -v`
main_test.go:185
FunctionTestRange
(t *testing.T)
main_test.go:126
FunctionTestRequestReplyCallback
(t *testing.T)
test_scenarios/request-reply-callback/main_test.go:11
FunctionTestRequestReplyWithCancellation
(t *testing.T)
test_scenarios/request-reply-with-cancellation/main_test.go:11
FunctionTestReusePayloadPointer
(t *testing.T)
main_test.go:52
FunctionTestSubTopicWhilePub
(t *testing.T)
main_test.go:11
FunctionTestUserRegistration
(t *testing.T)
test_scenarios/fire-and-forget/main_test.go:21
MethodTopic
Topic gives access to the underlying topic
main.go:94
FunctiongetKey
()
main.go:271
MethodonCreateOrder
(event *events.RequestEvent[Order])
test_scenarios/request-reply-callback/orders/repository.go:33
MethodonGetOrderStatus
(event *events.RequestEvent[OrderStatus])
test_scenarios/request-reply-callback/orders/repository.go:45