Documentation ¶
Overview ¶
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
Package mailbox implements mailbox queues and dispatching ¶
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
************************************************** Copyright 2016 https://github.com/AsynkronIT/protoactor-go
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLogLevel ¶
SetLogLevel sets the log level for the logger.
SetLogLevel is safe to call concurrently
Types ¶
type Dispatcher ¶
type Dispatcher interface { Schedule(fn func()) Throughput() int }
func NewDefaultDispatcher ¶
func NewDefaultDispatcher(throughput int) Dispatcher
func NewSynchronizedDispatcher ¶
func NewSynchronizedDispatcher(throughput int) Dispatcher
type Inbound ¶
type Inbound interface { PostUserMessage(message interface{}) PostSystemMessage(message interface{}) Start() }
The Inbound interface is used to enqueue messages to the mailbox
type MessageInvoker ¶
type MessageInvoker interface { InvokeSystemMessage(interface{}) InvokeUserMessage(interface{}) EscalateFailure(reason interface{}, message interface{}) }
MessageInvoker is the interface used by a mailbox to forward messages for processing
type Producer ¶
type Producer func(invoker MessageInvoker, dispatcher Dispatcher) Inbound
Producer is a function which creates a new mailbox
func Bounded ¶
func Bounded(size int, mailboxStats ...Statistics) Producer
Bounded returns a producer which creates an bounded mailbox of the specified size
func BoundedDropping ¶
func BoundedDropping(size int, mailboxStats ...Statistics) Producer
Bounded dropping returns a producer which creates an bounded mailbox of the specified size that drops front element on push
func Unbounded ¶
func Unbounded(mailboxStats ...Statistics) Producer
Unbounded returns a producer which creates an unbounded mailbox
func UnboundedLockfree ¶
func UnboundedLockfree(mailboxStats ...Statistics) Producer
UnboundedLockfree returns a producer which creates an unbounded, lock-free mailbox. This mailbox is cheaper to allocate, but has a slower throughput than the plain Unbounded mailbox.
type ResumeMailbox ¶
type ResumeMailbox struct{}
ResumeMailbox is message sent by the actor system to resume mailbox processing.
This will not be forwarded to the Receive method
type Statistics ¶
type Statistics interface { MailboxStarted() MessagePosted(message interface{}) MessageReceived(message interface{}) MailboxEmpty() }
type SuspendMailbox ¶
type SuspendMailbox struct{}
SuspendMailbox is message sent by the actor system to suspend mailbox processing.
This will not be forwarded to the Receive method