category
linda_server
Linda server predicates and tuple-space state. Import into a threaded object together with the linda_client category.
logtalk_load(linda(loader))staticPublic predicates
linda/1
Starts a Linda server with the given options. The predicate succeeds when all clients have disconnected after a shutdown request.
staticlinda(Options)linda(::)linda(+list) - one
Option
port(Port): UsePortas the server port. Must be an integer and an available port.Option
Address-Goal:Addressis unified withHost:PortandGoalis called when the server starts. Useful for saving the address or starting clients.Option
accept_hook(Client,Input,Output,Goal): When a client connects,Clientis unified with the client address,InputandOutputwith the connection streams, andGoalis called. IfGoalfails, the connection is rejected.
linda/0
Starts a Linda server on an automatically assigned port using default options. The server address (Host:Port) is written to the current output stream. The predicate succeeds when all clients have disconnected after a shutdown request.
staticlinda - oneProtected predicates
(no local declarations; see entity ancestors if any)
Private predicates
server_socket_/1
Stores the server socket descriptor.
dynamicserver_socket_(ServerSocket)server_socket_(?term) - zero_or_oneclient_connection_/3
Stores active client connections. Each client has an ID, input stream, and output stream.
dynamicclient_connection_(ClientId,InputStream,OutputStream)client_connection_(?term,?term,?term) - zero_or_moreaccept_hook_/1
Stores the optional accept hook goal to call when a client connects.
dynamicaccept_hook_(Hook)accept_hook_(?callable) - zero_or_oneserver_running_/1
Flag indicating the server is running.
dynamicserver_running_(Address)server_running_(?address) - zero_or_oneserver_shutdown_/0
Flag indicating the server has received a shutdown request.
dynamicserver_shutdown_ - zero_or_onetuple_/1
Stores tuples in the Linda tuple space.
dynamictuple_(Tuple)tuple_(?term) - zero_or_morewaiting_/3
Stores blocked clients waiting for tuples. Records the client ID, request pattern, and output stream.
dynamicwaiting_(ClientId,Request,OutputStream)waiting_(?term,?term,?term) - zero_or_moreclient_engine_/2
Maps client IDs to their corresponding threaded engine names.
dynamicclient_engine_(ClientId,EngineName)client_engine_(?term,?atom) - zero_or_morets_out/1
Synchronized predicate to add a tuple to the tuple space and wake waiting clients.
static, synchronizedts_out(Tuple)ts_out(+term) - onets_in/4
Synchronized predicate to remove a matching tuple or register a waiting client.
static, synchronizedts_in(Tuple,ClientId,OutputStream,Found)ts_in(+term,+term,+term,-compound) - onets_in_noblock/2
Synchronized predicate to try removing a matching tuple without blocking.
static, synchronizedts_in_noblock(Tuple,Found)ts_in_noblock(+term,-compound) - zero_or_onets_in_list/4
Synchronized predicate to remove a tuple matching one of multiple patterns or register a waiting client.
static, synchronizedts_in_list(TupleList,ClientId,OutputStream,Found)ts_in_list(+list,+term,+term,-compound) - onets_rd/4
Synchronized predicate to read a matching tuple or register a waiting client.
static, synchronizedts_rd(Tuple,ClientId,OutputStream,Found)ts_rd(+term,+term,+term,-compound) - onets_rd_noblock/2
Synchronized predicate to try reading a matching tuple without blocking.
static, synchronizedts_rd_noblock(Tuple,Found)ts_rd_noblock(+term,-compound) - zero_or_onets_rd_list/4
Synchronized predicate to read a tuple matching one of multiple patterns or register a waiting client.
static, synchronizedts_rd_list(TupleList,ClientId,OutputStream,Found)ts_rd_list(+list,+term,+term,-compound) - onets_findall_rd_noblock/3
Synchronized predicate to collect all tuples matching a pattern.
static, synchronizedts_findall_rd_noblock(Template,Tuple,List)ts_findall_rd_noblock(+term,+term,-list) - zero_or_morets_findall_in_noblock/3
Synchronized predicate to collect and remove all tuples matching a pattern.
static, synchronizedts_findall_in_noblock(Template,Tuple,List)ts_findall_in_noblock(+term,+term,-list) - zero_or_moreOperators
(none)